1//=-- lsan_allocator.h ----------------------------------------------------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9// 10// This file is a part of LeakSanitizer. 11// Allocator for standalone LSan. 12// 13//===----------------------------------------------------------------------===// 14 15#ifndef LSAN_ALLOCATOR_H 16#define LSAN_ALLOCATOR_H 17 18#include "sanitizer_common/sanitizer_common.h" 19#include "sanitizer_common/sanitizer_internal_defs.h" 20 21namespace __lsan { 22 23void *Allocate(const StackTrace &stack, uptr size, uptr alignment, 24 bool cleared); 25void Deallocate(void *p); 26void *Reallocate(const StackTrace &stack, void *p, uptr new_size, 27 uptr alignment); 28uptr GetMallocUsableSize(void *p); 29 30template<typename Callable> 31void ForEachChunk(const Callable &callback); 32 33void GetAllocatorCacheRange(uptr *begin, uptr *end); 34void AllocatorThreadFinish(); 35void InitializeAllocator(); 36 37} // namespace __lsan 38 39#endif // LSAN_ALLOCATOR_H 40