2013-05-20 18:54:00 +08:00
|
|
|
//=-- lsan_allocator.h ----------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file is a part of LeakSanitizer.
|
|
|
|
// Allocator for standalone LSan.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LSAN_ALLOCATOR_H
|
|
|
|
#define LSAN_ALLOCATOR_H
|
|
|
|
|
|
|
|
#include "sanitizer_common/sanitizer_common.h"
|
|
|
|
#include "sanitizer_common/sanitizer_internal_defs.h"
|
|
|
|
|
|
|
|
namespace __lsan {
|
|
|
|
|
|
|
|
void *Allocate(const StackTrace &stack, uptr size, uptr alignment,
|
|
|
|
bool cleared);
|
|
|
|
void Deallocate(void *p);
|
|
|
|
void *Reallocate(const StackTrace &stack, void *p, uptr new_size,
|
|
|
|
uptr alignment);
|
2014-08-26 22:28:28 +08:00
|
|
|
uptr GetMallocUsableSize(const void *p);
|
2013-05-20 18:54:00 +08:00
|
|
|
|
|
|
|
template<typename Callable>
|
|
|
|
void ForEachChunk(const Callable &callback);
|
|
|
|
|
|
|
|
void GetAllocatorCacheRange(uptr *begin, uptr *end);
|
|
|
|
void AllocatorThreadFinish();
|
|
|
|
void InitializeAllocator();
|
|
|
|
|
|
|
|
} // namespace __lsan
|
|
|
|
|
|
|
|
#endif // LSAN_ALLOCATOR_H
|