28 #ifndef D_TestMemoryAllocator_h
29 #define D_TestMemoryAllocator_h
31 struct MemoryLeakNode;
36 extern void setCurrentNewAllocatorToDefault();
41 extern void setCurrentNewArrayAllocatorToDefault();
46 extern void setCurrentMallocAllocatorToDefault();
52 TestMemoryAllocator(
const char* name_str =
"generic",
const char* alloc_name_str =
"alloc",
const char* free_name_str =
"free");
54 bool hasBeenDestroyed();
56 virtual char* alloc_memory(
size_t size,
const char* file,
int line);
57 virtual void free_memory(
char* memory,
const char* file,
int line);
59 virtual const char* name();
60 virtual const char* alloc_name();
61 virtual const char* free_name();
65 virtual char* allocMemoryLeakNode(
size_t size);
66 virtual void freeMemoryLeakNode(
char* memory);
71 const char* alloc_name_;
72 const char* free_name_;
74 bool hasBeenDestroyed_;
79 unsigned allocationToCrashOn_;
83 virtual void setNumberToCrashOn(
unsigned allocationToCrashOn);
85 virtual char* alloc_memory(
size_t size,
const char* file,
int line);
93 virtual char* alloc_memory(
size_t size,
const char* file,
int line);
94 virtual void free_memory(
char* memory,
const char* file,
int line);
Definition: TestMemoryAllocator.h:89
Definition: TestMemoryAllocator.h:77
Definition: TestMemoryAllocator.h:49