blob: f564601193bd3c1ee0bde71e44c06dcef49a17aa [file] [log] [blame]
Sergey Matveev866abfb2013-05-20 10:54:00 +00001//=-- 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);
Sergey Matveev08347ca2014-08-26 14:28:28 +000028uptr GetMallocUsableSize(const void *p);
Sergey Matveev866abfb2013-05-20 10:54:00 +000029
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