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