Changes the size of a buffer allocated with mpool_alloc or mpool_realloc.
void * mpool_realloc( MPOOL pool, void * buf, DWORD newlen );
pool
buf
newlen
buf
. Must be less than LONG_MAX. If the value of buf
is NULL, then mpool_realloc behaves like mpool_alloc. If buf
is not NULL and newlen
is zero, mpool_realloc returns a NULL pointer and the buffer is deleted. If the new size is smaller than the old size, then some data at the end of the old buffer is discarded. If the new size is larger than the old size, the caller must assume that new space contains uninitialized data. Whenever mpool_realloc returns a pointer different than the buf
pointer passed in, the caller must assume that the old pointer is invalid and must not use it any more.
All buffers are returned four byte aligned.
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 4.0 | intime/rt/include/mpool.h | mpool.h | clib.lib |