29 "Freeing memory after the leak detector has run. This can happen when using "
30 "static variables in C++ that are defined outside of functions. To fix this "
31 "error, use the 'construct on first use' idiom.";
35 bool fail_on_memleak =
false;
36 bool ignore_memleak =
false;
38 class MemLeakPrinter {
47 if (leaked_blocks == 0) {
51 printf(
"Error: Not freed memory blocks: %u, total unfreed memory %f MB\n",
56 if (fail_on_memleak) {
79 static MemLeakPrinter printer;
89 fail_on_memleak =
true;
Read Guarded memory(de)allocation.
void MEM_use_memleak_detection(bool enabled)
void MEM_enable_fail_on_memleak(void)
bool leak_detector_has_run
void MEM_init_memleak_detection(void)
char free_after_leak_detection_message[]
size_t(* MEM_get_memory_in_use)(void)
unsigned int(* MEM_get_memory_blocks_in_use)(void)
void(* MEM_printmemlist)(void)