diff options
author | Jason Evans <jasone@canonware.com> | 2016-10-21 06:59:12 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2016-10-21 06:59:12 (GMT) |
commit | b54d160dc4507eab5fb64e2e293019c5d3afd18c (patch) | |
tree | 1afc3d6a57b839231f3d03b5927b601ab7c7d42e /src/ctl.c | |
parent | 577d4572b0821a15e5370f9bf566d884b7cf707c (diff) | |
download | jemalloc-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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: |