| pmalloc, pcalloc, prealloc - allocate memory in a pool |
#include <pool.h> void *pmalloc (pool, size_t n); void *pcalloc (pool, size_t nmemb, size_t size); void *prealloc (pool, void *ptr, size_t n); |
| Allocate memory in a pool or, if pool is null, on the main heap (equivalent to plain malloc). If memory is allocated in a real pool, then it is automatically freed when the pool is deleted. |
| Memory returned is word-aligned. |
| If a memory allocation fails, the bad_malloc_handler function is called (which defaults to just calling abort(3)). |
| pcalloc is identical to pmalloc but also sets the memory to zero before returning it. |
| prealloc increases the size of an existing memory allocation. prealloc might move the memory in the process of reallocating it. |
| prealloc cannot reduce the size of an existing memory allocation. |
| Richard Jones <rich@annexia.org> |
| GNU LGPL (see http://www.gnu.org/) |
| c2lib-1.2.13 |