malloc, calloc, and all that Jazz...

Joshua Graham Pitcher ((no email))
Fri, 29 Mar 1996 10:46:10 +1100 (EST)

Okay proggers, something to get your teeth into!

I don't really understand how calloc and malloc works. Is calloc (and malloc
and dealloc) executed at compile time, or are they proper run time functions?

If they are run time functions (which I think they are) where is the
necessary info relating to these functions held? (for example, tables
showing which memory has been alloced and dealloced, etc).

If I malloc 32 bytes, then malloc 64 bytes, dealloc the first 32 bytes and
then malloc another 24 bytes, will this 24 byte allocation slot in where the
32 byte allocation used to be? If so, how does it keep track of memory
usage?

I did check a few books before posting, but non gave any meaty descriptions
of how these functions worked.

Thanks in advance,

Josh.