Vuo  2.4.1
VuoHeap.h
Go to the documentation of this file.
1
10#pragma once
11
12#include <stdlib.h>
13#include <stdbool.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
33typedef void (*DeallocateFunctionType)(void *);
34
35void VuoHeap_report(void);
36
48#define VuoRegister(heapPointer, deallocate) VuoRegisterF(heapPointer, deallocate, __FILE__, __LINE__, __func__, #heapPointer)
49int VuoRegisterF(const void *heapPointer, DeallocateFunctionType deallocate, const char *file, unsigned int linenumber, const char *func, const char *pointerName);
50
61#define VuoRegisterSingleton(heapPointer) VuoRegisterSingletonF(heapPointer, __FILE__, __LINE__, __func__, #heapPointer)
62int VuoRegisterSingletonF(const void *heapPointer, const char *file, unsigned int linenumber, const char *func, const char *pointerName);
63
64int VuoRetain(const void *heapPointer);
65
66int VuoRelease(const void *heapPointer);
67
109#define VuoLocal(heapPointer) VuoRetain(heapPointer); VuoDefer(^{VuoRelease(heapPointer);});
110
111bool VuoHeap_isPointerReadable(const void *pointer);
112char *VuoHeap_getDescription(const void *heapPointer);
113void VuoHeap_addTrace(const void *heapPointer);
114
121#define VuoWarnUnusedResult __attribute__((warn_unused_result))
122
129#define VuoIgnoreResult(a) (void)a
130
131#ifdef __cplusplus
132}
133#endif