server_heap_unit_allocate()

void * server_heap_unit_allocate(server_heap_t *heap, int wait_if_exhausted)

This function returns a unit of memory, whos size in bytes is the unit_size specified at heap creation time.

The wait_if_exhausted flag specifies wether it should block waiting for a unit to become available when the heap is empty and cannot be grown. Set it to 1 to enable this behavior, if you set it to 0 it will return immediately, just with NULL when the heap is exhausted. Generally you will want to set it to 1.



2007-12-06