VuoHeap interface.
Functions | |
void | finalizeReferenceCounts (void) |
Cleans up the reference-counting system. | |
void | printReferenceCounts () |
Prints all reference-counted pointers, for debugging. | |
void * | vuoAlloc (size_t numBytes) |
Allocates memory on the heap, and registers its pointer to be reference-counted. | |
int | vuoRegister (void *heapPointer) |
Registers heapPointer to be reference-counted. | |
int | vuoRetain (void *heapPointer) |
Increments the reference count for heapPointer . | |
int | vuoRelease (void *heapPointer) |
Decrements the reference count for heapPointer . | |
void finalizeReferenceCounts | ( | void | ) |
Cleans up the reference-counting system.
To be called once, after all other reference-counting function calls.
void* vuoAlloc | ( | size_t | numBytes | ) |
Allocates memory on the heap, and registers its pointer to be reference-counted.
numBytes | The number of bytes to allocate. |
int vuoRegister | ( | void * | heapPointer | ) |
Registers heapPointer
to be reference-counted.
If heapPointer
is already being reference-counted, does nothing.
heapPointer | A pointer to allocated memory on the heap. |
heapPointer
. This is 0 unless heapPointer
is already being reference-counted. int vuoRelease | ( | void * | heapPointer | ) |
Decrements the reference count for heapPointer
.
If the reference count becomes 0, heapPointer
is freed and is no longer reference-counted.
heapPointer | A pointer to allocated memory on the heap. |
heapPointer
. int vuoRetain | ( | void * | heapPointer | ) |
Increments the reference count for heapPointer
.
heapPointer | A pointer to allocated memory on the heap. |
heapPointer
.