diff options
author | Jason Evans <jasone@canonware.com> | 2014-09-12 00:04:03 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2014-09-12 00:04:03 (GMT) |
commit | c3e9e7b0412e97e4976507f914fd39901b023537 (patch) | |
tree | ac8b2fca6f31fca562b118d50523fbfdcd20d0c7 /src | |
parent | 9c640bfdd4e2f25180a32ed3704ce8e4c4cc21f1 (diff) | |
download | jemalloc-c3e9e7b0412e97e4976507f914fd39901b023537.zip jemalloc-c3e9e7b0412e97e4976507f914fd39901b023537.tar.gz jemalloc-c3e9e7b0412e97e4976507f914fd39901b023537.tar.bz2 |
Fix irallocx_prof() sample logic.
Fix irallocx_prof() sample logic to only update the threshold counter
after it knows what size the allocation ended up being. This regression
was caused by 6e73dc194ee9682d3eacaf725a989f04629718f7 (Fix a profile
sampling race.), which did not make it into any releases prior to this
fix.
Diffstat (limited to 'src')
-rw-r--r-- | src/jemalloc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/jemalloc.c b/src/jemalloc.c index dfb1266..c5b8f52 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -1582,7 +1582,7 @@ irallocx_prof(void *oldptr, size_t old_usize, size_t size, size_t alignment, prof_tctx_t *old_tctx, *tctx; old_tctx = prof_tctx_get(oldptr); - tctx = prof_alloc_prep(*usize, true); + tctx = prof_alloc_prep(*usize, false); if (unlikely((uintptr_t)tctx != (uintptr_t)1U)) { p = irallocx_prof_sample(oldptr, size, alignment, *usize, zero, try_tcache_alloc, try_tcache_dalloc, arena, tctx); @@ -1591,7 +1591,7 @@ irallocx_prof(void *oldptr, size_t old_usize, size_t size, size_t alignment, try_tcache_dalloc, arena); } if (unlikely(p == NULL)) { - prof_alloc_rollback(tctx, true); + prof_alloc_rollback(tctx, false); return (NULL); } @@ -1606,7 +1606,7 @@ irallocx_prof(void *oldptr, size_t old_usize, size_t size, size_t alignment, */ *usize = isalloc(p, config_prof); } - prof_realloc(p, *usize, tctx, true, old_usize, old_tctx); + prof_realloc(p, *usize, tctx, false, old_usize, old_tctx); return (p); } |