lsan_allocator.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. #ifndef LSAN_ALLOCATOR_H
  13. #define LSAN_ALLOCATOR_H
  14. #include "sanitizer_common/sanitizer_common.h"
  15. #include "sanitizer_common/sanitizer_internal_defs.h"
  16. namespace __lsan {
  17. void *Allocate(const StackTrace &stack, uptr size, uptr alignment,
  18. bool cleared);
  19. void Deallocate(void *p);
  20. void *Reallocate(const StackTrace &stack, void *p, uptr new_size,
  21. uptr alignment);
  22. uptr GetMallocUsableSize(const void *p);
  23. template<typename Callable>
  24. void ForEachChunk(const Callable &callback);
  25. void GetAllocatorCacheRange(uptr *begin, uptr *end);
  26. void AllocatorThreadFinish();
  27. void InitializeAllocator();
  28. } // namespace __lsan
  29. #endif // LSAN_ALLOCATOR_H