Mail Archives: djgpp/1998/11/29/14:12:47
Grzegorz Adam Hankiewicz wrote:
> Huh, quite horrible IMHO. I don't have the sources of libc, could you
> please tell me how are these chunk "limits" from a size of 10K to 1
> Mb?
Above 4K, the boundary sizes are each a power of two plus 4092.
In other words the range ((1<<N)+4092) through ((2<<N)+4091)
share a pool of chunks. For smaller chunks I didn't compute
the rule. You can download the sources of libc yourself:
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2/djlsr201.zip
I forget where I got lgp271s.zip from. I looked today at
Simtel and found:
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/lgp2811s.zip
instead. I haven't downloaded it, but I expect it includes
a malloc.c that will work as well as the one in 271. If it
doesn't, or you can't download it, I can email you the
malloc.c from 271.
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/
> >a free-source malloc.c in lgp271s.zip. I simply included that malloc.c
> >in the gcc command to build your program and the result worked
> >perfectly.
>
> Could you tell me exactly what files do I have to link with the
> source? Oh, and I believe I will also need the C++ compiler, right?
I don't have the C++ compiler, so you must not need it.
> Since Allegro uses Djgpp's malloc's, do you know how could I make the
> lib to use the other malloc instead?
This malloc is fully compatible with the rest of libc. You don't
need anything other than the malloc.c. If you include the malloc.c
in your gcc command it will be used in place of the malloc in libc.
If you are using an explicit ld command you can put the malloc.o
before libc and get the same result.
I am sure it is possible to replace the malloc.o inside
libc.a with the new one. If you do it that way, you would
have the new one all the time without changing your gcc or
ld commands. I don't happen to know how to use (or even
the name of) the program that manipulates .a files, but I
am sure it is documented.
--
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/
- Raw text -