summaryrefslogtreecommitdiffstats
path: root/src/tsd.c
diff options
context:
space:
mode:
authorQi Wang <interwq@gwu.edu>2018-05-08 19:12:50 (GMT)
committerQi Wang <interwq@gwu.edu>2018-05-08 19:12:50 (GMT)
commit61efbda7098de6fe64c362d309824864308c36d4 (patch)
tree62b8cec5495df891b28fbb139b0c01cdbf9f3fb3 /src/tsd.c
parent3f5049340e66c6929c3270f7359617f62e053b11 (diff)
parent1c51381b7cc62b6e0e77d02c42925c3776dbc4a2 (diff)
downloadjemalloc-5.1.0.zip
jemalloc-5.1.0.tar.gz
jemalloc-5.1.0.tar.bz2
Merge branch 'dev'5.1.0
Diffstat (limited to 'src/tsd.c')
-rw-r--r--src/tsd.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tsd.c b/src/tsd.c
index f968992..c143068 100644
--- a/src/tsd.c
+++ b/src/tsd.c
@@ -71,6 +71,16 @@ tsd_data_init(tsd_t *tsd) {
*/
rtree_ctx_data_init(tsd_rtree_ctxp_get_unsafe(tsd));
+ /*
+ * A nondeterministic seed based on the address of tsd reduces
+ * the likelihood of lockstep non-uniform cache index
+ * utilization among identical concurrent processes, but at the
+ * cost of test repeatability. For debug builds, instead use a
+ * deterministic seed.
+ */
+ *tsd_offset_statep_get(tsd) = config_debug ? 0 :
+ (uint64_t)(uintptr_t)tsd;
+
return tsd_tcache_enabled_data_init(tsd);
}