next up previous contents index
Next: 11.4.4 free: Free a Up: 11.4 Memory Interface Previous: 11.4.2 realloc: Reallocate a

11.4.3 alloc_aligned: Allocate a chunk of memory subject to alignment constraints

 

SYNOPSIS

#include <oskit/com/mem.h>

oskit_error_t oskit_mem_alloc_aligned(oskit_mem_t *m, oskit_u32_t size, oskit_u32_t flags, oskit_u32_t align);

DESCRIPTION

Allocate a chunk of memory of size bytes, subject to various options specified in flags, and an alignment constraint specifed by align. The alignment constraint is a power of two integer, which indicates the minimum required alignment for the new chunk. If successful, a pointer to the new chunk of memory is returned. Othersize a NULL pointer is returned. The new memory must be deallocated with the free method described below.

PARAMETERS

m
The memory object to operate on.
size
The size (in bytes) of the chunk to allocate.
flags
Allocation options and constraints.
align
The alignment constraint for the new chunk.

RETURNS

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



Utah Flux Research Group