sanitizer_allocator_interface.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //===-- sanitizer_allocator_interface.h ------------------------- C++ -----===//
  2. //
  3. // This file is distributed under the University of Illinois Open Source
  4. // License. See LICENSE.TXT for details.
  5. //
  6. //===----------------------------------------------------------------------===//
  7. //
  8. // Re-declaration of functions from public sanitizer allocator interface.
  9. //
  10. //===----------------------------------------------------------------------===//
  11. #ifndef SANITIZER_ALLOCATOR_INTERFACE_H
  12. #define SANITIZER_ALLOCATOR_INTERFACE_H
  13. #include "sanitizer_internal_defs.h"
  14. using __sanitizer::uptr;
  15. extern "C" {
  16. SANITIZER_INTERFACE_ATTRIBUTE
  17. uptr __sanitizer_get_estimated_allocated_size(uptr size);
  18. SANITIZER_INTERFACE_ATTRIBUTE int __sanitizer_get_ownership(const void *p);
  19. SANITIZER_INTERFACE_ATTRIBUTE uptr
  20. __sanitizer_get_allocated_size(const void *p);
  21. SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_current_allocated_bytes();
  22. SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_heap_size();
  23. SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_free_bytes();
  24. SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_unmapped_bytes();
  25. SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
  26. /* OPTIONAL */ void __sanitizer_malloc_hook(void *ptr, uptr size);
  27. SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
  28. /* OPTIONAL */ void __sanitizer_free_hook(void *ptr);
  29. } // extern "C"
  30. #endif // SANITIZER_ALLOCATOR_INTERFACE_H