next up previous contents index
Next: 15.6.9 lmm_free: free previously-allocated Up: 15.6 API reference Previous: 15.6.7 lmm_alloc_gen: allocate memory

15.6.8 lmm_alloc_page: allocate a page of memory

   

SYNOPSIS

#include <oskit/lmm.h>

void *lmm_alloc_page(lmm_t *lmm, lmm_flags_t flags);

DESCRIPTION

This routine allocates a memory block that is exactly one minimum-size hardware page in size, and is naturally aligned to a page boundary. The same effect can be achieved by calling lmm_alloc_aligned with appropriate parameters; this routine merely provides a simpler interface for this extremely common action.

PARAMETERS

lmm
The memory pool from which to allocate.
flags
The memory type required for this allocation. For each bit set in the flags parameter, the corresponding bit in a region's flags word must also be set in order for the region to be considered for allocation. If the flags parameter is zero, memory will be allocated from any region.

RETURNS

Returns a pointer to the memory page allocated, or NULL if no naturally-aligned page can be found.



University of Utah Flux Research Group