15 "Freeing memory after the leak detector has run. This can happen when using "
16 "static variables in C++ that are defined outside of functions. To fix this "
17 "error, use the 'construct on first use' idiom.";
21 bool fail_on_memleak =
false;
22 bool ignore_memleak =
false;
24 class MemLeakPrinter {
33 if (leaked_blocks == 0) {
37 printf(
"Error: Not freed memory blocks: %u, total unfreed memory %f MB\n",
42 if (fail_on_memleak) {
65 static MemLeakPrinter printer;
75 fail_on_memleak =
true;
Read Guarded memory(de)allocation.
void MEM_use_memleak_detection(bool enabled)
void MEM_enable_fail_on_memleak()
bool leak_detector_has_run
void MEM_init_memleak_detection()
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)