2014-03-25 Richard Biener <rguenther@suse.de>
[official-gcc.git] / libsanitizer / lsan / lsan_allocator.h
blob61ea86572ef3d43973be3be51dd7b7dae5cc0a7f
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.
11 //===----------------------------------------------------------------------===//
13 #ifndef LSAN_ALLOCATOR_H
14 #define LSAN_ALLOCATOR_H
16 #include "sanitizer_common/sanitizer_common.h"
17 #include "sanitizer_common/sanitizer_internal_defs.h"
19 namespace __lsan {
21 void *Allocate(const StackTrace &stack, uptr size, uptr alignment,
22 bool cleared);
23 void Deallocate(void *p);
24 void *Reallocate(const StackTrace &stack, void *p, uptr new_size,
25 uptr alignment);
26 uptr GetMallocUsableSize(void *p);
28 template<typename Callable>
29 void ForEachChunk(const Callable &callback);
31 void GetAllocatorCacheRange(uptr *begin, uptr *end);
32 void AllocatorThreadFinish();
33 void InitializeAllocator();
35 } // namespace __lsan
37 #endif // LSAN_ALLOCATOR_H