llvm/compiler-rt/lib/asan/asan_allocator.cpp

//===-- asan_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
//
//===----------------------------------------------------------------------===//
//
// This file is a part of AddressSanitizer, an address sanity checker.
//
// Implementation of ASan's memory allocator, 2-nd version.
// This variant uses the allocator from sanitizer_common, i.e. the one shared
// with ThreadSanitizer and MemorySanitizer.
//
//===----------------------------------------------------------------------===//

#include "asan_allocator.h"

#include "asan_internal.h"
#include "asan_mapping.h"
#include "asan_poisoning.h"
#include "asan_report.h"
#include "asan_stack.h"
#include "asan_thread.h"
#include "lsan/lsan_common.h"
#include "sanitizer_common/sanitizer_allocator_checks.h"
#include "sanitizer_common/sanitizer_allocator_interface.h"
#include "sanitizer_common/sanitizer_common.h"
#include "sanitizer_common/sanitizer_errno.h"
#include "sanitizer_common/sanitizer_flags.h"
#include "sanitizer_common/sanitizer_internal_defs.h"
#include "sanitizer_common/sanitizer_list.h"
#include "sanitizer_common/sanitizer_quarantine.h"
#include "sanitizer_common/sanitizer_stackdepot.h"

__asan  // namespace __asan

// --- Implementation of LSan-specific functions --- {{{1
namespace __lsan {
void LockAllocator() {}

void UnlockAllocator() {}

void GetAllocatorGlobalRange(uptr *begin, uptr *end) {}

uptr PointsIntoChunk(void *p) {}

uptr GetUserBegin(uptr chunk) {}

uptr GetUserAddr(uptr chunk) {}

LsanMetadata::LsanMetadata(uptr chunk) {}

bool LsanMetadata::allocated() const {}

ChunkTag LsanMetadata::tag() const {}

void LsanMetadata::set_tag(ChunkTag value) {}

uptr LsanMetadata::requested_size() const {}

u32 LsanMetadata::stack_trace_id() const {}

void ForEachChunk(ForEachChunkCallback callback, void *arg) {}

IgnoreObjectResult IgnoreObject(const void *p) {}

}  // namespace __lsan

// ---------------------- Interface ---------------- {{{1
usingnamespace__asan;

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

// ASan allocator doesn't reserve extra bytes, so normally we would
// just return "size". We don't want to expose our redzone sizes, etc here.
uptr __sanitizer_get_estimated_allocated_size(uptr size) {}

int __sanitizer_get_ownership(const void *p) {}

uptr __sanitizer_get_allocated_size(const void *p) {}

uptr __sanitizer_get_allocated_size_fast(const void *p) {}

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

void __sanitizer_purge_allocator() {}

int __asan_update_allocation_context(void* addr) {}