llvm/compiler-rt/lib/memprof/memprof_stats.cpp

//===-- memprof_stats.cpp ------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file is a part of MemProfiler, a memory profiler.
//
// Code related to statistics collected by MemProfiler.
//===----------------------------------------------------------------------===//
#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;
// Required for malloc_zone_statistics() on OS X. This can't be stored in
// per-thread MemprofStats.
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() {}

} // namespace __memprof

// ---------------------- Interface ---------------- {{{1
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() {}