1 #ifndef _MUSL_MALLOC_H 2 #define _MUSL_MALLOC_H 3 4 #include "malloc.h" 5 6 #ifdef __cplusplus 7 extern "C" { 8 #endif 9 10 #ifdef HOOK_ENABLE 11 #define MuslMalloc(func) __libc_ ## func 12 #else 13 #define MuslMalloc(func) func 14 #endif 15 16 void *__libc_mmap(void*, size_t, int, int, int, off_t); 17 int __libc_munmap(void*, size_t); 18 void *__libc_malloc(size_t); 19 void *__libc_calloc(size_t, size_t); 20 void *__libc_realloc(void *, size_t); 21 void __libc_free(void *); 22 void *__libc_valloc(size_t); 23 void *__libc_memalign(size_t, size_t); 24 size_t __libc_malloc_usable_size(void *); 25 26 struct mallinfo2 __libc_mallinfo2(void); 27 28 int __libc_malloc_iterate(void* base, size_t size, void (*callback)(void* base, size_t size, void* arg), void* arg); 29 void __libc_malloc_disable(void); 30 void __libc_malloc_enable(void); 31 32 int __libc_malloc_info(int options, FILE* fp); 33 void __libc_malloc_stats_print(void (*write_cb) (void *, const char *), void *cbopaque, const char *opts); 34 35 int __libc_mallopt(int param, int value); 36 ssize_t __libc_malloc_backtrace(void* pointer, uintptr_t* frames, size_t frame_count); 37 38 39 #ifdef __cplusplus 40 } 41 #endif 42 43 #endif 44