|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Technical Support On-Line Manuals C166 User's Guide |
C166 User's GuideMemory Allocation Routines
The memory allocation functions provide you with a means to specify, allocate, and free blocks of memory from a memory pool. Standard memory allocation functions are implemented as functions and are prototyped in the stdlib.h include file. Fixed block size memory allocation routines are prototyped in membox.h. Before using any of these functions to allocate memory, you must first specify the size and location of the memory pool using the init_mempool routine or the size, location, and block size using the _init_box? routines. All memory requests are satisfied from the specified memory block. The calloc, malloc, _alloc_box?, and _calloc_box? routines allocate blocks of memory from the pool. The calloc routine allocates an array with a specified number of elements of a given size and initializes the array to 0. The malloc routine allocates a specified number of bytes. The _alloc_box? and _calloc_box? routines allocate a single fixed-size block from the memory pool. The realloc routine changes the size of an allocated block. The free and _free_box? routines return a previously allocated memory block to the memory pool. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||