Vuo  1.2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Macros | Typedefs | Functions
VuoHeap.h File Reference

Description

VuoHeap interface.

Macros

#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).
 
#define VuoRegisterSingleton(heapPointer)
 Registers heapPointer as a singleton, meaning that VuoRetain and VuoRelease will have no effect on it (and will not issue warnings).
 
#define VuoLocal(heapPointer)
 Immediately retains heapPointer, and automatically releases it at the end of the local scope.
 

Typedefs

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.
 

Functions

void VuoHeap_report (void)
 Sends a telemetry error with information about any objects remaining in the reference counting table.
 
int VuoRegisterF (const void *heapPointer, DeallocateFunctionType deallocate, const char *file, unsigned int line, const char *func, const char *pointerName)
 Instead of this function, you probably want to use VuoRegister().
 
int VuoRegisterSingletonF (const void *heapPointer, const char *file, unsigned int line, const char *func, const char *pointerName)
 Instead of this function, you probably want to use VuoRegisterSingleton().
 
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).
 
const char * VuoHeap_getDescription (const void *heapPointer)
 Returns a description of the specified heapPointer: the file, line, and function where VuoRegister() was called, and the variable name.
 
void VuoHeap_addTrace (const void *heapPointer)
 Pass a pointer to this function to log all its subsequent retains and releases.
 

Function Documentation

void VuoHeap_addTrace ( const void *  heapPointer)

Pass a pointer to this function to log all its subsequent retains and releases.

This only has any effect when preprocessor macro VUOHEAP_TRACE is defined in VuoHeap.cc.

const char* VuoHeap_getDescription ( const void *  heapPointer)

Returns a description of the specified heapPointer: the file, line, and function where VuoRegister() was called, and the variable name.

The caller is responsible for freeing the returned string.

void VuoHeap_report ( void  )

Sends a telemetry error with information about any objects remaining in the reference counting table.

int VuoRegisterF ( const void *  heapPointer,
DeallocateFunctionType  deallocate,
const char *  file,
unsigned int  line,
const char *  func,
const char *  pointerName 
)

Instead of this function, you probably want to use VuoRegister().

This function is used to implement the VuoRegister() macro.

Registers heapPointer to be reference-counted and stores its deallocate function (unless heapPointer is null or is already being reference-counted).

Parameters
heapPointerA pointer to allocated memory on the heap.
deallocateThe function to be used to deallocate the memory when the reference count gets back to its original value of 0.
fileThe name of the file in which VuoRegister() is called.
lineThe line in the file in which VuoRegister() is called.
funcThe function in which VuoRegister() is called.
pointerNameThe stringified pointer variable name.
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.
int VuoRegisterSingletonF ( const void *  heapPointer,
const char *  file,
unsigned int  line,
const char *  func,
const char *  pointerName 
)

Instead of this function, you probably want to use VuoRegisterSingleton().

This function is used to implement the VuoRegisterSingleton() macro.