X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f Message-ID: <3C4B185A.CE5251D7@yahoo.com> From: CBFalconer Organization: Ched Research X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.c,comp.os.msdos.djgpp,comp.compilers.lcc Subject: Re: hash library - interface criticisms References: <3C4ADB8E DOT 552CAE40 AT yahoo DOT com> <3C4B0ED1 DOT 3F274F98 AT is DOT elta DOT co DOT il> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 36 Date: Mon, 21 Jan 2002 02:49:45 GMT NNTP-Posting-Host: 12.90.169.251 X-Complaints-To: abuse AT worldnet DOT att DOT net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1011581385 12.90.169.251 (Mon, 21 Jan 2002 02:49:45 GMT) NNTP-Posting-Date: Mon, 21 Jan 2002 02:49:45 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Eli Zaretskii wrote: > > John wrote: > > > > As a follow-up, I just did a test inserting 500,000 nodes of a linked list, > > this involves setting the previous and next pointers and the data item, > > amongst other things. This took 280ms. (I have quite a fast machine) > > > > To free the same 500,000 nodes it takes 9,236ms, and the code in this case > > is only walking through the list and calling free(). > > I think the DJGPP implementation of malloc is optimized for allocations more > than deallocations. But you can easily see where're the hot spots if you > compile malloc.c from the library with -pg, link with -pg, and then profile > the test program. That's the beauty of Free Software: the sources are > freely available to study and scrutinize. > > I have no idea what does lcc use in its library. > > Btw, a program should not need to free its heap before it exits. The OS > will take care about it. No, but ending the usage of this package does not necessarily mean program exit. I am not particularly trying to fix it, as long as it is not my fault. The problem is on free, not malloc. I am primarily trying to call attention to a generic failing. As I said elsewhere, lccwin32 uses the CRTDLL.DLL windows package, which has the same problem. At least I suspect so. -- Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT XXXXworldnet DOT att DOT net) Available for consulting/temporary embedded and systems. (Remove "XXXX" from reply address. yahoo works unmodified) mailto:uce AT ftc DOT gov (for spambots to harvest)