next up previous contents index
Next: 11.4.7 avail: Return the Up: 11.4 Memory Interface Previous: 11.4.5 getsize: Inquire about

11.4.6 alloc_gen: Allocate a chunk of memory with general constraints

 

SYNOPSIS

#include <oskit/com/mem.h>

void * oskit_mem_alloc_gen(oskit_mem_t *m, oskit_u32_t size, oskit_u32_t flags, oskit_u32_t align_bits, oskit_u32_t align_ofs);

DESCRIPTION

Allocate a chunk of memory meeting various alignment and address constraints. It is similar to alloc, but is intended to provide an interface more like lmm_alloc_gen (see Section 22).

PARAMETERS

m
The memory object to operate on.
size
The size (in bytes) of the chunk to allocate.
flags
Allocation options and constraints.
align_bits
The number of low bits of the returned memory chunk address that must match the corresponding bits in align_ofs.
align_ofs
The required offset from natural power-of-two alignment. If align_ofs is zero, then the returned memory block will be naturally aligned on a tex2html_wrap_inline37101 boundary.

RETURNS

Returns a pointer to the chunk of memory on success, or NULL if the request could not be satisfied.



Utah Flux Research Group