next up previous contents index
Next: 15.6.2 lmm_add_region: register a Up: 15.6 API reference Previous: 15.6 API reference

15.6.1 lmm_init: initialize an LMM pool

 

SYNOPSIS

#include <oskit/lmm.h>

void lmm_init(lmm_t *lmm);

DESCRIPTION

This function initializes an LMM pool. The caller must provide a pointer to an lmm_t structure, which is typically (but doesn't have to be) statically allocated; the LMM system uses this structure to keep track of the state of the LMM pool. In subsequent LMM operations, the caller must pass back a pointer to the same lmm structure, which acts as a handle for the LMM pool.

Note that the LMM pool initially contains no regions or free memory; thus, immediate attempts to allocate memory from it will fail. The caller must register one or more memory regions using lmm_add_region, and then add some free memory to the pool using lmm_add_free, before the LMM pool will become useful for servicing allocations.

PARAMETERS

lmm
A pointer to an uninitialized structure of type lmm_t which is to be used to represent the LMM pool.



University of Utah Flux Research Group