#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);
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).
- 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
boundary.
Returns a pointer to the chunk of memory on success, or NULL if the request could not be satisfied.