Mail Archives: djgpp/1998/11/29/14:46:53
Grzegorz Adam Hankiewicz wrote:
> not solved this, and to the moment of writting this nobody answered
> > 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.
Now that I found the answer, I am surprised it is not in the
FAQ (or is it there and I somehow missed it?)
> > 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.
> Accordingly I have installed bnu281b.zip, gcc281b.zip, djdev201.zip,
The malloc in libc.a in djdev201.zip seems to come from
malloc.c in djlsr201.zip.
In the source code, the restriction is very clear. Memory is
allocated in fixed chunks and those chunks are never split and
never combined. If you ask for 1048576, you get 1052668
(preceeded by 4 bytes overhead). When you release it, it can
be reallocated as any size from 528381 to 1052668; But it can
never be used for any other size.
There are other GNU malloc.c routines that you could use.
I just searched my own hard drive (not even the web) and found
a free-source malloc.c in lgp271s.zip (which I had downloaded,
I forget when, from Simtel).
I simply included that malloc.c in the gcc command to build
your program and the result worked perfectly. I did not need
to use any other part of lgp271s.zip.
(If I understood your comment earlier, you DO NOT want the
copy-by-email that I normally send when replying in a
newsgroup.)
--
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/
- Raw text -