summaryrefslogtreecommitdiffstats
path: root/deps/jemalloc/include/jemalloc/internal/test_hooks.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:40:54 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:40:54 +0000
commit317c0644ccf108aa23ef3fd8358bd66c2840bfc0 (patch)
treec417b3d25c86b775989cb5ac042f37611b626c8a /deps/jemalloc/include/jemalloc/internal/test_hooks.h
parentInitial commit. (diff)
downloadredis-317c0644ccf108aa23ef3fd8358bd66c2840bfc0.tar.xz
redis-317c0644ccf108aa23ef3fd8358bd66c2840bfc0.zip
Adding upstream version 5:7.2.4.upstream/5%7.2.4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'deps/jemalloc/include/jemalloc/internal/test_hooks.h')
-rw-r--r--deps/jemalloc/include/jemalloc/internal/test_hooks.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/deps/jemalloc/include/jemalloc/internal/test_hooks.h b/deps/jemalloc/include/jemalloc/internal/test_hooks.h
new file mode 100644
index 0000000..3d530b5
--- /dev/null
+++ b/deps/jemalloc/include/jemalloc/internal/test_hooks.h
@@ -0,0 +1,24 @@
+#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)();
+
+#if defined(JEMALLOC_JET) || defined(JEMALLOC_UNIT_TEST)
+# define JEMALLOC_TEST_HOOK(fn, hook) ((void)(hook != NULL && (hook(), 0)), fn)
+
+# define open JEMALLOC_TEST_HOOK(open, test_hooks_libc_hook)
+# define read JEMALLOC_TEST_HOOK(read, test_hooks_libc_hook)
+# define write JEMALLOC_TEST_HOOK(write, test_hooks_libc_hook)
+# define readlink JEMALLOC_TEST_HOOK(readlink, test_hooks_libc_hook)
+# define close JEMALLOC_TEST_HOOK(close, test_hooks_libc_hook)
+# define creat JEMALLOC_TEST_HOOK(creat, test_hooks_libc_hook)
+# define secure_getenv JEMALLOC_TEST_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_TEST_HOOK(_Unwind_Backtrace, test_hooks_libc_hook)
+#else
+# define JEMALLOC_TEST_HOOK(fn, hook) fn
+#endif
+
+
+#endif /* JEMALLOC_INTERNAL_TEST_HOOKS_H */