#include "memprof_stats.h"
#include "memprof_interceptors.h"
#include "memprof_internal.h"
#include "memprof_thread.h"
#include "sanitizer_common/sanitizer_allocator_interface.h"
#include "sanitizer_common/sanitizer_mutex.h"
#include "sanitizer_common/sanitizer_stackdepot.h"
namespace __memprof {
MemprofStats::MemprofStats() { … }
void MemprofStats::Clear() { … }
static void PrintMallocStatsArray(const char *prefix,
uptr (&array)[kNumberOfSizeClasses]) { … }
void MemprofStats::Print() { … }
void MemprofStats::MergeFrom(const MemprofStats *stats) { … }
static Mutex print_lock;
static MemprofStats unknown_thread_stats(LINKER_INITIALIZED);
static MemprofStats dead_threads_stats(LINKER_INITIALIZED);
static Mutex dead_threads_stats_lock;
static uptr max_malloced_memory;
static void MergeThreadStats(ThreadContextBase *tctx_base, void *arg) { … }
static void GetAccumulatedStats(MemprofStats *stats) { … }
void FlushToDeadThreadStats(MemprofStats *stats) { … }
MemprofStats &GetCurrentThreadStats() { … }
static void PrintAccumulatedStats() { … }
}
usingnamespace__memprof;
uptr __sanitizer_get_current_allocated_bytes() { … }
uptr __sanitizer_get_heap_size() { … }
uptr __sanitizer_get_free_bytes() { … }
uptr __sanitizer_get_unmapped_bytes() { … }
void __memprof_print_accumulated_stats() { … }