20 "Freeing memory after the leak detector has run. This can happen when using "
21 "static variables in C++ that are defined outside of functions. To fix this "
22 "error, use the 'construct on first use' idiom.";
26bool fail_on_memleak =
false;
27bool ignore_memleak =
false;
38 if (leaked_blocks == 0) {
42 printf(
"Error: Not freed memory blocks: %u, total unfreed memory %f MB\n",
52 if (fail_on_memleak) {
71 std::any any_data = std::make_any<int>(0);
83 static MemLeakPrinter printer;
93 fail_on_memleak =
true;
98 static std::mutex
mutex;
99 static std::vector<std::any> data_vec;
101 data_vec.push_back(std::move(data));
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)
void(* mem_clearmemlist)(void)
uint(* MEM_get_memory_blocks_in_use)(void)
void(* MEM_printmemlist)(void)
void memory_usage_init(void)
void add_memleak_data(std::any data)