summaryrefslogtreecommitdiff
path: root/src/shared/leaktrace.h
blob: 4985925e13fe0b54b5646f770776f6309000bdf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef LEAKTRACE_H
#define LEAKTRACE_H


namespace LeakTrace {

void TraceAlloc(void *ptr, const char *functionName, int line);
void TraceDealloc(void *ptr);

};

#ifdef TRACE_LEAKS

#define LEAK_TRACE LeakTrace::TraceAlloc(this, __FUNCTION__, __LINE__)
#define LEAK_UNTRACE LeakTrace::TraceDealloc(this)

#else // TRACE_LEAKS

#define LEAK_TRACE
#define LEAK_UNTRACE

#endif // TRACE_LEAKS

#endif // LEAKTRACE_H