1 //===-- sanitizer_allocator_interface.h ------------------------- C++ -----===// 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 // Re-declaration of functions from public sanitizer allocator interface. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef SANITIZER_ALLOCATOR_INTERFACE_H 15 #define SANITIZER_ALLOCATOR_INTERFACE_H 16 17 #include "sanitizer_internal_defs.h" 18 19 using __sanitizer::uptr; 20 21 extern "C" { 22 SANITIZER_INTERFACE_ATTRIBUTE 23 uptr __sanitizer_get_estimated_allocated_size(uptr size); 24 SANITIZER_INTERFACE_ATTRIBUTE int __sanitizer_get_ownership(const void *p); 25 SANITIZER_INTERFACE_ATTRIBUTE uptr 26 __sanitizer_get_allocated_size(const void *p); 27 SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_current_allocated_bytes(); 28 SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_heap_size(); 29 SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_free_bytes(); 30 SANITIZER_INTERFACE_ATTRIBUTE uptr __sanitizer_get_unmapped_bytes(); 31 32 SANITIZER_INTERFACE_ATTRIBUTE int __sanitizer_install_malloc_and_free_hooks( 33 void (*malloc_hook)(const void *, uptr), 34 void (*free_hook)(const void *)); 35 36 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE 37 /* OPTIONAL */ void __sanitizer_malloc_hook(void *ptr, uptr size); 38 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE 39 /* OPTIONAL */ void __sanitizer_free_hook(void *ptr); 40 } // extern "C" 41 42 #endif // SANITIZER_ALLOCATOR_INTERFACE_H 43