summaryrefslogtreecommitdiff
path: root/include/jemalloc/internal/test_hooks.h
diff options
context:
space:
mode:
authorDanny Lin <danny@kdrag0n.dev>2021-10-11 20:49:26 -0700
committeralk3pInjection <5e147612@kscope.ink>2022-05-08 12:40:50 +0800
commite36e52fb6ec54bc47e17e849ca5a3a301eaa6d05 (patch)
tree854d309be91bcdd38fe46ea8ad0f906bef39d017 /include/jemalloc/internal/test_hooks.h
parent6d4d27fd2651ed114386b89c2d251b816a849460 (diff)
parentea6b3e973b477b8061e0076bb257dbd7f3faa756 (diff)
Merge tag '5.2.1' into HEAD
Release Change-Id: I269b861cb81499b78f13dc2e88827f13ef5a207d
Diffstat (limited to 'include/jemalloc/internal/test_hooks.h')
-rw-r--r--include/jemalloc/internal/test_hooks.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/jemalloc/internal/test_hooks.h b/include/jemalloc/internal/test_hooks.h
new file mode 100644
index 00000000..a6351e59
--- /dev/null
+++ b/include/jemalloc/internal/test_hooks.h
@@ -0,0 +1,19 @@
+#ifndef JEMALLOC_INTERNAL_TEST_HOOKS_H
+#define JEMALLOC_INTERNAL_TEST_HOOKS_H
+
+extern JEMALLOC_EXPORT void (*test_hooks_arena_new_hook)();
+extern JEMALLOC_EXPORT void (*test_hooks_libc_hook)();
+
+#define JEMALLOC_HOOK(fn, hook) ((void)(hook != NULL && (hook(), 0)), fn)
+
+#define open JEMALLOC_HOOK(open, test_hooks_libc_hook)
+#define read JEMALLOC_HOOK(read, test_hooks_libc_hook)
+#define write JEMALLOC_HOOK(write, test_hooks_libc_hook)
+#define readlink JEMALLOC_HOOK(readlink, test_hooks_libc_hook)
+#define close JEMALLOC_HOOK(close, test_hooks_libc_hook)
+#define creat JEMALLOC_HOOK(creat, test_hooks_libc_hook)
+#define secure_getenv JEMALLOC_HOOK(secure_getenv, test_hooks_libc_hook)
+/* Note that this is undef'd and re-define'd in src/prof.c. */
+#define _Unwind_Backtrace JEMALLOC_HOOK(_Unwind_Backtrace, test_hooks_libc_hook)
+
+#endif /* JEMALLOC_INTERNAL_TEST_HOOKS_H */