From: "John S. Fine" Newsgroups: comp.os.msdos.djgpp Subject: Re: Djgpp doesn't free the memory? What am I doing wrong? Date: Fri, 27 Nov 1998 14:49:55 -0500 Lines: 31 Message-ID: <365F0263.27D0@erols.com> References: <36594f0d DOT 209084 AT news DOT jet DOT es> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ilIVPOLXwjrcLHe4+2CA237I9qqKzraVaJxbvUku5+g= X-Complaints-To: abuse AT rcn DOT com NNTP-Posting-Date: 27 Nov 1998 19:50:56 GMT X-Mailer: Mozilla 3.01 (Win95; U) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Grzegorz Adam Hankiewicz wrote: > Anyway, I have coded a small example where the program first allocates > a 25 meg memory chunk, and the 1 meg chunks until the whole ram is > consumed. > > Then, it tries to allocate a 5 meg chunk. If he cannot, he goes > through the list freeing the pointers. The 25 meg chunk is the first > on the list. > > But, the example ends and it cannot allocate the 5 meg chunk, because > the pointers are not freed. Did you figure it out, or did anyone answer by private email? I have been waiting to see an answer in the newsgroup and haven't seen one. There must be an expert here who knows what is going on, but I sure don't. Your code looks correct and on my machine it fails as you described. I doubt there is a bug that serious in malloc and no one has mentioned it before, but I can't think of any other explanation. What version of the lib*.a files are you using? (When I figure out which version *I* am using, I may look at the malloc source code for clues. I reinstalled djgpp a couple times and lost track of what comes from where). -- http://www.erols.com/johnfine/ http://www.geocities.com/SiliconValley/Peaks/8600/