InitHeap

Initialize the heap

void InitHeap (
        void *head,
        long size
)

Arguments

head Pointer to heap start address
size Heap size (multiple of 4 bytes)

Return Value

None.

Explanation

The heap pointed to by head is initialized. Memory management functions are also initialized, so that malloc() and the other memory allocation functions can be used.
The effective heap size is actually less than size because of overhead.

Notes

Multiple calls to InitHeap() are permitted only if they do not overlap, otherwise memory management functions will not operate properly.

See Also

malloc()