summaryrefslogtreecommitdiffstats
path: root/src/ctl.c
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2016-10-21 06:59:12 (GMT)
committerJason Evans <jasone@canonware.com>2016-10-21 06:59:12 (GMT)
commitb54d160dc4507eab5fb64e2e293019c5d3afd18c (patch)
tree1afc3d6a57b839231f3d03b5927b601ab7c7d42e /src/ctl.c
parent577d4572b0821a15e5370f9bf566d884b7cf707c (diff)
downloadjemalloc-b54d160dc4507eab5fb64e2e293019c5d3afd18c.zip
jemalloc-b54d160dc4507eab5fb64e2e293019c5d3afd18c.tar.gz
jemalloc-b54d160dc4507eab5fb64e2e293019c5d3afd18c.tar.bz2
Do not (recursively) allocate within tsd_fetch().
Refactor tsd so that tsdn_fetch() does not trigger allocation, since allocation could cause infinite recursion. This resolves #458.
Diffstat (limited to 'src/ctl.c')
-rw-r--r--src/ctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ctl.c b/src/ctl.c
index 067b677..47b4768 100644
--- a/src/ctl.c
+++ b/src/ctl.c
@@ -1326,7 +1326,7 @@ tcache_create_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp,
malloc_mutex_lock(tsd_tsdn(tsd), &ctl_mtx);
READONLY();
- if (tcaches_create(tsd_tsdn(tsd), &tcache_ind)) {
+ if (tcaches_create(tsd, &tcache_ind)) {
ret = EFAULT;
goto label_return;
}
@@ -1871,7 +1871,7 @@ prof_reset_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp,
if (lg_sample >= (sizeof(uint64_t) << 3))
lg_sample = (sizeof(uint64_t) << 3) - 1;
- prof_reset(tsd_tsdn(tsd), lg_sample);
+ prof_reset(tsd, lg_sample);
ret = 0;
label_return: