Standards
Standards / Extensions |
C or C++ |
Dependencies |
Language Environment |
both |
|
Format
#include <uheap.h>
void *__umalloc(__uheapid_t heapid, size_t size);
General description
The __umalloc() function allocates storage from the heap identified
by the heapid. __umalloc() will search for an available cell within
the cell pool that contains cells at least as large and closest in
size to the requested size.
- Parameter
- Description
- heapid
- The identifier of the user-created heap from which the storage
is to be allocated.
- size
- The amount of storage to be allocated.
Returned value
If successful, __umalloc() returns a pointer to the reserved cell.
If a cell of the required size is not available, if size was larger
than the largest available cell size, or if size was specified as
0, __umalloc() returns NULL.
If there is not enough storage or if the requested size was too
large, __umalloc() returns NULL and sets errno to one of the following
values:
- Error Code
- Description
- E2BIG
- Requested amount of storage is larger than the largest available
cell size
- ENOMEM
- Insufficient memory is available