Allocates a memory block of the specified size from a memory pool, aligned to the specified boundary. Unlike mpool_alloc_aligned, the returned pointer can be freed directly via mpool_free — no separate base pointer is needed.
void * mpool_alloc_alignedex(
MPOOL pool,
DWORD size,
DWORD align );
pool
size
size is 0 (zero), a valid pointer returns, but the size of the actual buffer is 16. Any value less than 16 returns a buffer of size 16. Must be a power of two.
align
Success:
A pointer to the allocated space, aligned to the specified boundary. To get a pointer to a type other than void, use a type cast on the return value.
Failure:
E2BIG |
The size is too large. |
ENOSPC |
Out of virtual memory. |
EEXIST |
The pool is deleted. |
EINVAL |
The pool is not a valid MPOOL. |
ENOMEM |
Out of physical memory. |
| Versions | Defined in | Include | Link to |
|---|---|---|---|
| INtime 7.3 | intime/clib/include/mpool.h | mpool.h | clib.lib |