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