Files
snmalloc/src/override/malloc-extensions.cc
2021-10-20 18:38:08 +01:00

14 lines
374 B
C++

#include "malloc-extensions.h"
#include "../snmalloc.h"
using namespace snmalloc;
void get_malloc_info_v1(malloc_info_v1* stats)
{
auto unused_chunks = Globals::get_chunk_allocator_state().unused_memory();
auto peak = Globals::get_chunk_allocator_state().peak_memory_usage();
stats->current_memory_usage = peak - unused_chunks;
stats->peak_memory_usage = peak;
}