next up previous contents index
Next: 15.6.12 lmm_find_free: scan a Up: 15.6 API reference Previous: 15.6.10 lmm_free_page: free a

15.6.11 lmm_avail: find the amount of free memory in an LMM pool

 

SYNOPSIS

#include <oskit/lmm.h>

oskit_size_t lmm_avail(lmm_t *lmm, lmm_flags_t *flags);

DESCRIPTION

This routine returns the number of bytes of free memory currently exist in the specified LMM memory pool of a certain memory type, specified by the flags argument.

Note that the returned value does not imply that a block of that size can be allocated; due to fragmentation it may only be possible to allocate memory in significantly smaller chunks.

PARAMETERS

lmm
The LMM pool in which to tally free memory.
flags
The memory type to determine the availability of. Only memory regions whose flags words contain all the bits set in the flags parameter will be considered in counting available memory. If flags is zero, then all free memory in the LMM pool will be counted.

RETURNS

Returns the number of bytes of free memory available of the requested memory type.



University of Utah Flux Research Group