1 //===-- sanitizer_allocator_interface.h ------------------------- C++ -----===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // Re-declaration of functions from public sanitizer allocator interface.
11 //===----------------------------------------------------------------------===//
13 #ifndef SANITIZER_ALLOCATOR_INTERFACE_H
14 #define SANITIZER_ALLOCATOR_INTERFACE_H
16 #include "sanitizer_internal_defs.h"
18 using __sanitizer::uptr
;
21 SANITIZER_INTERFACE_ATTRIBUTE
22 uptr
__sanitizer_get_estimated_allocated_size(uptr size
);
23 SANITIZER_INTERFACE_ATTRIBUTE
int __sanitizer_get_ownership(const void *p
);
24 SANITIZER_INTERFACE_ATTRIBUTE uptr
25 __sanitizer_get_allocated_size(const void *p
);
26 SANITIZER_INTERFACE_ATTRIBUTE uptr
__sanitizer_get_current_allocated_bytes();
27 SANITIZER_INTERFACE_ATTRIBUTE uptr
__sanitizer_get_heap_size();
28 SANITIZER_INTERFACE_ATTRIBUTE uptr
__sanitizer_get_free_bytes();
29 SANITIZER_INTERFACE_ATTRIBUTE uptr
__sanitizer_get_unmapped_bytes();
31 SANITIZER_INTERFACE_ATTRIBUTE
int __sanitizer_install_malloc_and_free_hooks(
32 void (*malloc_hook
)(const void *, uptr
),
33 void (*free_hook
)(const void *));
35 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
36 void __sanitizer_malloc_hook(void *ptr
, uptr size
);
37 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
38 void __sanitizer_free_hook(void *ptr
);
40 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
void
41 __sanitizer_purge_allocator();
43 SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE
void
44 __sanitizer_print_memory_profile(uptr top_percent
, uptr max_number_of_contexts
);
47 #endif // SANITIZER_ALLOCATOR_INTERFACE_H