char *malloc(size) unsigned size; void free(ptr) char *ptr; char *realloc(ptr, size) char *ptr; unsigned size; char calloc(nelem, elsize) unsigned nelem, elsize; int dump_malloc()
Malloc returns a pointer to a block of at least size bytes.
Free returns the space previously allocated with calloc() or malloc() as pointed to by the argument ptr. Contents of the block are preserved until the next malloc() or calloc() call.
Realloc changes the size of the blocked pointed to by ptr to the size given by argument two in bytes. Contents of the block will be unchanged up to either the original size or the new size, whichever is smaller.
Calloc allocates space via malloc and intializes the space to zeros. The amount of space allocated is set up to handle an array of nelem elements of size elsize.
Dump_malloc provides a means to debug pointer references by dumping a list of all blocks within m286's free list or those currently allocated to the standard error device. The listing contains LLINK, RLINK which are pointers to the previous and next blocks on the free list. TAG and ETAG are flags indicating whether the block is in use or not. ULINK is always a pointer to the beginning of the block. All of the fields are displayed as indexes into a array of words within the allocated segment.
This software is copyright and can only be used and distributed for non-commercial use. Commerical licenses can be obtained from mike@cimcor.mn.org for a very low cost.