#include "tsan_mman.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"
#include "sanitizer_common/sanitizer_placement_new.h"
#include "sanitizer_common/sanitizer_stackdepot.h"
#include "tsan_flags.h"
#include "tsan_interface.h"
#include "tsan_report.h"
#include "tsan_rtl.h"
namespace __tsan {
struct MapUnmapCallback { … };
alignas(64) static char allocator_placeholder[sizeof(Allocator)];
Allocator *allocator() { … }
struct GlobalProc { … };
alignas(64) static char global_proc_placeholder[sizeof(GlobalProc)];
GlobalProc *global_proc() { … }
static void InternalAllocAccess() { … }
ScopedGlobalProcessor::ScopedGlobalProcessor() { … }
ScopedGlobalProcessor::~ScopedGlobalProcessor() { … }
void AllocatorLockBeforeFork() SANITIZER_NO_THREAD_SAFETY_ANALYSIS { … }
void AllocatorUnlockAfterFork(bool child) SANITIZER_NO_THREAD_SAFETY_ANALYSIS { … }
void GlobalProcessorLock() SANITIZER_NO_THREAD_SAFETY_ANALYSIS { … }
void GlobalProcessorUnlock() SANITIZER_NO_THREAD_SAFETY_ANALYSIS { … }
static constexpr uptr kMaxAllowedMallocSize = …;
static uptr max_user_defined_malloc_size;
void InitializeAllocator() { … }
void InitializeAllocatorLate() { … }
void AllocatorProcStart(Processor *proc) { … }
void AllocatorProcFinish(Processor *proc) { … }
void AllocatorPrintStats() { … }
static void SignalUnsafeCall(ThreadState *thr, uptr pc) { … }
void *user_alloc_internal(ThreadState *thr, uptr pc, uptr sz, uptr align,
bool signal) { … }
void user_free(ThreadState *thr, uptr pc, void *p, bool signal) { … }
void *user_alloc(ThreadState *thr, uptr pc, uptr sz) { … }
void *user_calloc(ThreadState *thr, uptr pc, uptr size, uptr n) { … }
void *user_reallocarray(ThreadState *thr, uptr pc, void *p, uptr size, uptr n) { … }
void OnUserAlloc(ThreadState *thr, uptr pc, uptr p, uptr sz, bool write) { … }
void OnUserFree(ThreadState *thr, uptr pc, uptr p, bool write) { … }
void *user_realloc(ThreadState *thr, uptr pc, void *p, uptr sz) { … }
void *user_memalign(ThreadState *thr, uptr pc, uptr align, uptr sz) { … }
int user_posix_memalign(ThreadState *thr, uptr pc, void **memptr, uptr align,
uptr sz) { … }
void *user_aligned_alloc(ThreadState *thr, uptr pc, uptr align, uptr sz) { … }
void *user_valloc(ThreadState *thr, uptr pc, uptr sz) { … }
void *user_pvalloc(ThreadState *thr, uptr pc, uptr sz) { … }
static const void *user_alloc_begin(const void *p) { … }
uptr user_alloc_usable_size(const void *p) { … }
uptr user_alloc_usable_size_fast(const void *p) { … }
void invoke_malloc_hook(void *ptr, uptr size) { … }
void invoke_free_hook(void *ptr) { … }
void *Alloc(uptr sz) { … }
void FreeImpl(void *p) { … }
}
usingnamespace__tsan;
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() { … }
void __tsan_on_thread_idle() { … }
}