#ifndef MEMPROF_ALLOCATOR_H
#define MEMPROF_ALLOCATOR_H
#include "memprof_flags.h"
#include "memprof_interceptors.h"
#include "memprof_internal.h"
#include "sanitizer_common/sanitizer_allocator.h"
#include "sanitizer_common/sanitizer_list.h"
#if !defined(__x86_64__)
#error Unsupported platform
#endif
#if !SANITIZER_CAN_USE_ALLOCATOR64
#error Only 64-bit allocator supported
#endif
namespace __memprof {
enum AllocType { … };
void InitializeAllocator();
struct MemprofMapUnmapCallback { … };
constexpr uptr kAllocatorSpace = …;
constexpr uptr kAllocatorSize = …;
SizeClassMap;
template <typename AddressSpaceViewTy>
struct AP64 { … };
PrimaryAllocatorASVT;
PrimaryAllocator;
static const uptr kNumberOfSizeClasses = …;
MemprofAllocatorASVT;
MemprofAllocator;
AllocatorCache;
struct MemprofThreadLocalMallocStorage { … };
void *memprof_memalign(uptr alignment, uptr size, BufferedStackTrace *stack,
AllocType alloc_type);
void memprof_free(void *ptr, BufferedStackTrace *stack, AllocType alloc_type);
void memprof_delete(void *ptr, uptr size, uptr alignment,
BufferedStackTrace *stack, AllocType alloc_type);
void *memprof_malloc(uptr size, BufferedStackTrace *stack);
void *memprof_calloc(uptr nmemb, uptr size, BufferedStackTrace *stack);
void *memprof_realloc(void *p, uptr size, BufferedStackTrace *stack);
void *memprof_reallocarray(void *p, uptr nmemb, uptr size,
BufferedStackTrace *stack);
void *memprof_valloc(uptr size, BufferedStackTrace *stack);
void *memprof_pvalloc(uptr size, BufferedStackTrace *stack);
void *memprof_aligned_alloc(uptr alignment, uptr size,
BufferedStackTrace *stack);
int memprof_posix_memalign(void **memptr, uptr alignment, uptr size,
BufferedStackTrace *stack);
uptr memprof_malloc_usable_size(const void *ptr);
void PrintInternalAllocatorStats();
}
#endif