From: "A.Appleyard" Organization: Materials Science Centre To: DJGPP AT DELORIE DOT COM Date: Wed, 29 Jan 1997 09:14:46 GMT Subject: Re: A misfeature re malloc() and new Message-ID: ### Please send a copy of the reply to me at a DOT appleyard AT fs2 DOT mt DOT umist DOT ac DOT uk, as I had to unsubscribe from djgpp because of excessive email intray overload (1) Please where can I read dggpp email group's archives by FTP or WWW? ------------------------------------------------------------------ (2) Mark Wodrich wrote:- > You have checked the source, so I bow to your superior knowledge, BUT: How > can this be? The more I hear about djgpp's malloc, the more I shudder! Is > this "standard" GNU implementation of malloc/free? It seems horribly > wasteful.... Perhaps someone should spend a while coding a decent heap > manager for djgpp? (hacking the source is your only "workaround" as I see > it...) I understand that malloc is optimised for speed, but a > half-intelligent heap manager can't be that slow can it ? From the basic 2nd > year Computer Science I did, a heap is not that big a deal to code. Merging > freed blocks, and using first fit, best fit, or worst fit was (I thought) > standard practice. It seems from your post that GNU libc keeps tables of > blocks for each 2^n size...? It is so now under v2, and it was so under v1. djgpp's heap needs a garbage collecter. I could write one easily; but it would need to know the whereabouts of pointers-to-heap that may need to be updated during the garbage collection. In any software that I write, it is fairly easy to keep track of pointers-to-heap; but I will need to know the whereabouts of all pointers-to-heap created by standard library routines. Of the functions and subroutines declared by these #includes, which use the heap?: ctype.h dpmi.h fcntl.h go32.h new.h pc.h setjmp.h std.h string.h sys/exceptn.h sys/farptr.h sys/stat.h time.h The matter which is automatically obeyed before main() is called: does it use the heap? ------------------------------------------------------------------ (3) As a character in a book by James Herriot (vet) once wrote: "It allus [= always] ends up wi' malloc() at t'finish.". (Mallock was a knacker-man.) ------------------------------------------------------------------ (4) > "It is now safe to turn off your computer." - Windows 95 After struggling with Windows 95 after a lifetime of Windows 3.1 & similar:- As to where whoever-it-was got his ideas for Windows 95, I would not be surprised if I found that he keeps a UFO in his garage. Part of the Windows 95 system is called `Chicago'. Perhaps that is why Windows 95 looks like the result of letting Al Capone run the computer room.