Functions to manage memory for heap-allocated port and node instance data.
|
#define | VuoRegister(heapPointer, deallocate) |
| Registers heapPointer to be reference-counted and stores its deallocate function (unless heapPointer is null or is already being reference-counted).
|
|
|
typedef void(* | DeallocateFunctionType )(void *) |
| A type for destructor functions, such as free(void *) , which are used to deallocate reference-counted memory when it's no longer in use.
|
|
|
int | VuoRetain (const void *heapPointer) |
| Increments the reference count for heapPointer (unless heapPointer is not being reference-counted).
|
|
int | VuoRelease (const void *heapPointer) |
| Decrements the reference count for heapPointer (unless heapPointer is not being reference-counted).
|
|
#define VuoRegister |
( |
|
heapPointer, |
|
|
|
deallocate |
|
) |
| |
Registers heapPointer to be reference-counted and stores its deallocate function (unless heapPointer is null or is already being reference-counted).
- Parameters
-
heapPointer | A pointer to allocated memory on the heap. |
deallocate | The function to be used to deallocate the memory when the reference count gets back to its original value of 0. |
- Returns
- The updated reference count of heapPointer. This is 0 if heapPointer is not already being reference-counted, greater than 0 if it is, or -1 if heapPointer is null.
typedef void(* DeallocateFunctionType)(void *) |
A type for destructor functions, such as free(void *)
, which are used to deallocate reference-counted memory when it's no longer in use.
int VuoRelease |
( |
const void * |
heapPointer | ) |
|
Decrements the reference count for heapPointer (unless heapPointer is not being reference-counted).
If the reference count becomes 0, heapPointer is deallocated and is no longer reference-counted.
- Parameters
-
heapPointer | A pointer to allocated memory on the heap. |
- Returns
- The updated reference count of heapPointer, or -1 if heapPointer is not being reference-counted, has never been retained, or is null.
int VuoRetain |
( |
const void * |
heapPointer | ) |
|
Increments the reference count for heapPointer (unless heapPointer is not being reference-counted).
- Parameters
-
heapPointer | A pointer to allocated memory on the heap. |
- Returns
- The updated reference count of heapPointer, or -1 if heapPointer is not being reference-counted or is null.