summaryrefslogtreecommitdiffstats
path: root/src/tsd.c
diff options
context:
space:
mode:
authorDavid Goldblatt <davidgoldblatt@fb.com>2017-03-29 00:30:54 (GMT)
committerDavid Goldblatt <davidtgoldblatt@gmail.com>2017-04-07 21:10:27 (GMT)
commit0a0fcd3e6a0816f0a56fa852416d0ece861c0abb (patch)
tree49b3c934dd8308e7c3bf31692184ef72bb1e8a0d /src/tsd.c
parent36bd90b96212772f1adbd421a6b091b542278995 (diff)
downloadjemalloc-0a0fcd3e6a0816f0a56fa852416d0ece861c0abb.zip
jemalloc-0a0fcd3e6a0816f0a56fa852416d0ece861c0abb.tar.gz
jemalloc-0a0fcd3e6a0816f0a56fa852416d0ece861c0abb.tar.bz2
Add hooking functionality
This allows us to hook chosen functions and do interesting things there (in particular: reentrancy checking).
Diffstat (limited to 'src/tsd.c')
-rw-r--r--src/tsd.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tsd.c b/src/tsd.c
index 8b54770..0d5de8e 100644
--- a/src/tsd.c
+++ b/src/tsd.c
@@ -149,6 +149,15 @@ _tls_callback(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
return true;
}
+/*
+ * We need to be able to say "read" here (in the "pragma section"), but have
+ * hooked "read". We won't read for the rest of the file, so we can get away
+ * with unhooking.
+ */
+#ifdef read
+# undef read
+#endif
+
#ifdef _MSC_VER
# ifdef _M_IX86
# pragma comment(linker, "/INCLUDE:__tls_used")