Go forward to Functions
Go backward to Implementation
Go up to Implementation
Go to the top op mmalloc
To allow a single malloc package to be used in a given application,
provision is made for the traditional `malloc', `realloc', and `free'
functions to be implemented as special cases of the `mmalloc'
functions. In particular, if any of the functions that expect malloc
descriptors are called with a `NULL' pointer rather than a valid malloc
descriptor, then they default to using an `sbrk' managed region. The
`mmalloc' package provides compatible `malloc', `realloc', and `free'
functions using this mechanism internally. Applications can avoid this
extra interface layer by simply including the following defines:
#define malloc(size) mmalloc ((void *)0, (size))
#define realloc(ptr,size) mrealloc ((void *)0, (ptr), (size));
#define free(ptr) mfree ((void *)0, (ptr))
or replace the existing `malloc', `realloc', and `free' calls with the
above patterns if using `#define' causes problems.
Created Mon Nov 8 17:42:56 2004 on tillpc with info_to_html version 0.9.6.