INtime SDK Help
mpool_alloc
INtime SDK v6 > About INtime > Other system libraries > Heaps and memory pools > Memory pools > mpool_alloc

Allocates a new buffer from a memory pool.

void * mpool_alloc(
    MPOOL pool, 
    DWORD size
);

Parameters

pool
The memory pool created by mpool_create.
size
The requested buffer's size. This value must be less than LONG_MAX. If the value of 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.

Return Values

A pointer to the new buffer
Success.
NULL
Failure. The function sets errno to one of these values:
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.

Requirements

Versions Defined in Include Link to
INtime 4.0 intime/rt/include/mpool.h mpool.h clib.lib
   
See Also