X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f From: "John" Newsgroups: comp.lang.c,comp.os.msdos.djgpp,comp.compilers.lcc Subject: Re: hash library - interface criticisms Date: Sun, 20 Jan 2002 19:22:17 -0000 Lines: 31 Message-ID: References: <3C4ADB8E DOT 552CAE40 AT yahoo DOT com> <3C4B0ED1 DOT 3F274F98 AT is DOT elta DOT co DOT il> NNTP-Posting-Host: host213-122-193-76.btinternet.com (213.122.193.76) X-Trace: fu-berlin.de 1011554500 34412422 213.122.193.76 (16 [97861]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Eli Zaretskii" wrote in message news:3C4B0ED1 DOT 3F274F98 AT is DOT elta DOT co DOT il... > John wrote: > > > > 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. It uses crt.dll as default but one can link with msvcrt.lib and use msvcrt.dll instead. > Btw, a program should not need to free its heap before it exits. The OS > will take care about it. That's true, but one's programme may need to free these allocations multiple times whilst running. John