1 #ifndef JEMALLOC_INTERNAL_HOOKS_H 2 #define JEMALLOC_INTERNAL_HOOKS_H 3 4 extern JEMALLOC_EXPORT void (*hooks_arena_new_hook)(); 5 extern JEMALLOC_EXPORT void (*hooks_libc_hook)(); 6 7 #define JEMALLOC_HOOK(fn, hook) ((void)(hook != NULL && (hook(), 0)), fn) 8 9 #define open JEMALLOC_HOOK(open, hooks_libc_hook) 10 #define read JEMALLOC_HOOK(read, hooks_libc_hook) 11 #define write JEMALLOC_HOOK(write, hooks_libc_hook) 12 #define readlink JEMALLOC_HOOK(readlink, hooks_libc_hook) 13 #define close JEMALLOC_HOOK(close, hooks_libc_hook) 14 #define creat JEMALLOC_HOOK(creat, hooks_libc_hook) 15 #define secure_getenv JEMALLOC_HOOK(secure_getenv, hooks_libc_hook) 16 /* Note that this is undef'd and re-define'd in src/prof.c. */ 17 #define _Unwind_Backtrace JEMALLOC_HOOK(_Unwind_Backtrace, hooks_libc_hook) 18 19 #endif /* JEMALLOC_INTERNAL_HOOKS_H */ 20