Mail Archives: djgpp/1992/02/05/11:29:57
> Hey all you. I can see you.
Funny, we've never transmitted any pictures :-)
> Well, anyway, I was curious how malloc() and calloc() get memory
>from the heap. Was this difficult for you, or did you let the guy who
>wrote gcc do most it? I don't need to know exactly how, but just a sort of
>lay man's type of explanation.
The standard malloc() algorithm is to use sbrk() to expand the linear
memory space it has access to, then maintaining information about how
it's divvied into chunks for the program. The sbrk() call is usually
an OS call, even in go32, which adjusts the MMU to grant access to
more memory. The malloc() in djgpp is directly from the BSD sources,
without modification.
DJ
dj AT ctron DOT com
Life is a banana.
- Raw text -