server_heap_unit_unref()

void server_heap_unit_unref(void *_unit)

This function decrements the reference count on the unit, notice that there is no server_heap_unit_free() function, that is because server_heap_unit_unref() is essentially that function.

When you allocate a unit from the heap, its reference count is set to 1. The unit will not be freed until ti gets back to 0, by calling this function to do so.

Note that these functions are all thread safe at the moment, a mutex is stuffed away in the unit where you can't see it, next to the reference count, so ref and unref can be called freely from many threads.



2007-12-06