llvm/compiler-rt/lib/nsan/nsan_allocator.cpp

//===- nsan_allocator.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
//
//===----------------------------------------------------------------------===//
//
// NumericalStabilitySanitizer allocator.
//
//===----------------------------------------------------------------------===//

#include "nsan_allocator.h"
#include "interception/interception.h"
#include "nsan.h"
#include "nsan_flags.h"
#include "nsan_platform.h"
#include "nsan_thread.h"
#include "sanitizer_common/sanitizer_allocator.h"
#include "sanitizer_common/sanitizer_allocator_checks.h"
#include "sanitizer_common/sanitizer_allocator_interface.h"
#include "sanitizer_common/sanitizer_allocator_report.h"
#include "sanitizer_common/sanitizer_common.h"
#include "sanitizer_common/sanitizer_errno.h"

usingnamespace__nsan;

DECLARE_REAL()
DECLARE_REAL()

namespace {
struct Metadata {};

struct NsanMapUnmapCallback {};

const uptr kMaxAllowedMallocSize =;

// Allocator64 parameters. Deliberately using a short name.
struct AP64 {};
} // namespace

PrimaryAllocator;
Allocator;
AllocatorCache;

static Allocator allocator;
static AllocatorCache fallback_allocator_cache;
static StaticSpinMutex fallback_mutex;

static uptr max_malloc_size;

void __nsan::NsanAllocatorInit() {}

static AllocatorCache *GetAllocatorCache(NsanThreadLocalMallocStorage *ms) {}

void NsanThreadLocalMallocStorage::Init() {}

void NsanThreadLocalMallocStorage::CommitBack() {}

static void *NsanAllocate(uptr size, uptr alignment, bool zero) {}

void __nsan::NsanDeallocate(void *p) {}

static void *NsanReallocate(void *ptr, uptr new_size, uptr alignment) {}

static void *NsanCalloc(uptr nmemb, uptr size) {}

static const void *AllocationBegin(const void *p) {}

static uptr AllocationSizeFast(const void *p) {}

static uptr AllocationSize(const void *p) {}

void *__nsan::nsan_malloc(uptr size) {}

void *__nsan::nsan_calloc(uptr nmemb, uptr size) {}

void *__nsan::nsan_realloc(void *ptr, uptr size) {}

void *__nsan::nsan_reallocarray(void *ptr, uptr nmemb, uptr size) {}

void *__nsan::nsan_valloc(uptr size) {}

void *__nsan::nsan_pvalloc(uptr size) {}

void *__nsan::nsan_aligned_alloc(uptr alignment, uptr size) {}

void *__nsan::nsan_memalign(uptr alignment, uptr size) {}

int __nsan::nsan_posix_memalign(void **memptr, uptr alignment, uptr size) {}

extern "C" {
uptr __sanitizer_get_current_allocated_bytes() {}

uptr __sanitizer_get_heap_size() {}

uptr __sanitizer_get_free_bytes() {}

uptr __sanitizer_get_unmapped_bytes() {}

uptr __sanitizer_get_estimated_allocated_size(uptr size) {}

int __sanitizer_get_ownership(const void *p) {}

const void *__sanitizer_get_allocated_begin(const void *p) {}

uptr __sanitizer_get_allocated_size(const void *p) {}

uptr __sanitizer_get_allocated_size_fast(const void *p) {}

void __sanitizer_purge_allocator() {}
}