 | C166 User's Guide |  |
|
|
| _init_boxn| Summary |
#include <membox.h>
int _init_boxn (
void near *box_mem, /* pool address */
unsigned int box_mem_size, /* pool size */
unsigned int box_size); /* block size */
| | Description | The _init_boxn routine initializes a fixed block size memory pool. The box_mem argument specifies the starting address of the pool and the box_mem_size argument specifies the size of the pool (in bytes). The box_size argument specifies the size of each block (in bytes). Note - This routine is reentrant and thread-safe. It may be called from the main function and an interrupt with no restrictions.
- The _init_boxn function requires only 6 bytes for internal handling of the data pool. All the remaining memory is available to the user. The _init_boxn function is therefore a lot more efficient than the ANSI C standard memory allocation functions.
| | Return Value | The _init_boxn routine returns a value of 1 if the memory box was initialized with no problems or a value of 0 to indicate an initialization error. | | See Also | _alloc_boxn, _calloc_boxn, _free_boxn |
|
|