diff options
| author | Jason Evans <jasone@canonware.com> | 2016-06-01 16:19:22 -0700 |
|---|---|---|
| committer | Jason Evans <jasone@canonware.com> | 2016-06-05 20:42:24 -0700 |
| commit | 819417580e60f063d2a0dc83044a1b4d8994e50a (patch) | |
| tree | 55dd716e5cfa2bce96fb78996351e6e14869af6a /src/jemalloc.c | |
| parent | b14fdaaca0f3a8affac1bef468c3e446c56abbe2 (diff) | |
| download | platform_external_jemalloc_new-819417580e60f063d2a0dc83044a1b4d8994e50a.tar.gz platform_external_jemalloc_new-819417580e60f063d2a0dc83044a1b4d8994e50a.tar.bz2 platform_external_jemalloc_new-819417580e60f063d2a0dc83044a1b4d8994e50a.zip | |
Fix rallocx() sampling code to not eagerly commit sampler update.
rallocx() for an alignment-constrained request may end up with a
smaller-than-worst-case size if in-place reallocation succeeds due to
serendipitous alignment. In such cases, sampling may not happen.
Diffstat (limited to 'src/jemalloc.c')
| -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 c5fd4419..2d33464c 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -2155,7 +2155,7 @@ irallocx_prof(tsd_t *tsd, extent_t *old_extent, void *old_ptr, size_t old_usize, prof_active = prof_active_get_unlocked(); old_tctx = prof_tctx_get(tsd_tsdn(tsd), old_extent, old_ptr); - tctx = prof_alloc_prep(tsd, *usize, prof_active, true); + tctx = prof_alloc_prep(tsd, *usize, prof_active, false); if (unlikely((uintptr_t)tctx != (uintptr_t)1U)) { p = irallocx_prof_sample(tsd_tsdn(tsd), old_extent, old_ptr, old_usize, *usize, alignment, zero, tcache, arena, tctx); @@ -2164,7 +2164,7 @@ irallocx_prof(tsd_t *tsd, extent_t *old_extent, void *old_ptr, size_t old_usize, size, alignment, zero, tcache, arena); } if (unlikely(p == NULL)) { - prof_alloc_rollback(tsd, tctx, true); + prof_alloc_rollback(tsd, tctx, false); return (NULL); } @@ -2181,7 +2181,7 @@ irallocx_prof(tsd_t *tsd, extent_t *old_extent, void *old_ptr, size_t old_usize, *usize = isalloc(tsd_tsdn(tsd), extent, p); } else extent = iealloc(tsd_tsdn(tsd), p); - prof_realloc(tsd, extent, p, *usize, tctx, prof_active, true, + prof_realloc(tsd, extent, p, *usize, tctx, prof_active, false, old_extent, old_ptr, old_usize, old_tctx); return (p); |
