summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQi Wang <interwq@gwu.edu>2017-04-06 05:04:12 (GMT)
committerQi Wang <interwq@gmail.com>2017-04-07 21:06:17 (GMT)
commit4dec507546040896338d8bbdb2075c7ad3a4b9f3 (patch)
tree565c39dfef985d870cd9300d58082401fedc74e6
parent0fba57e579e688d0ccda5a615c91ab66cd4ba54a (diff)
downloadjemalloc-4dec507546040896338d8bbdb2075c7ad3a4b9f3.zip
jemalloc-4dec507546040896338d8bbdb2075c7ad3a4b9f3.tar.gz
jemalloc-4dec507546040896338d8bbdb2075c7ad3a4b9f3.tar.bz2
Bypass witness_fork in TSD when !config_debug.
With the tcache change, we plan to leave some blank space when !config_debug (unused tbins, witnesses) at the end of the tsd. Let's not touch the memory.
-rw-r--r--src/witness.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/witness.c b/src/witness.c
index 034ea92..cbffaea 100644
--- a/src/witness.c
+++ b/src/witness.c
@@ -96,16 +96,25 @@ witnesses_cleanup(tsd_t *tsd) {
void
witness_prefork(tsd_t *tsd) {
+ if (!config_debug) {
+ return;
+ }
tsd_witness_fork_set(tsd, true);
}
void
witness_postfork_parent(tsd_t *tsd) {
+ if (!config_debug) {
+ return;
+ }
tsd_witness_fork_set(tsd, false);
}
void
witness_postfork_child(tsd_t *tsd) {
+ if (!config_debug) {
+ return;
+ }
#ifndef JEMALLOC_MUTEX_INIT_CB
witness_list_t *witnesses;