Threshold is no longer updated before prof_realloc()

This commit is contained in:
Yinan Zhang 2019-12-10 10:03:54 -08:00
parent 7e3671911f
commit 055478cca8
2 changed files with 5 additions and 5 deletions

View File

@ -132,14 +132,14 @@ prof_malloc(tsd_t *tsd, const void *ptr, size_t usize, alloc_ctx_t *alloc_ctx,
JEMALLOC_ALWAYS_INLINE void
prof_realloc(tsd_t *tsd, const void *ptr, size_t usize, prof_tctx_t *tctx,
bool prof_active, bool updated, const void *old_ptr, size_t old_usize,
bool prof_active, const void *old_ptr, size_t old_usize,
prof_info_t *old_prof_info) {
bool sampled, old_sampled, moved;
cassert(config_prof);
assert(ptr != NULL || (uintptr_t)tctx <= (uintptr_t)1U);
if (prof_active && !updated && ptr != NULL) {
if (prof_active && ptr != NULL) {
assert(usize == isalloc(tsd_tsdn(tsd), ptr));
if (prof_sample_accum_update(tsd, usize, true)) {
/*

View File

@ -3037,8 +3037,8 @@ irallocx_prof(tsd_t *tsd, void *old_ptr, size_t old_usize, size_t size,
*/
*usize = isalloc(tsd_tsdn(tsd), p);
}
prof_realloc(tsd, p, *usize, tctx, prof_active, false, old_ptr,
old_usize, &old_prof_info);
prof_realloc(tsd, p, *usize, tctx, prof_active, old_ptr, old_usize,
&old_prof_info);
return p;
}
@ -3314,7 +3314,7 @@ ixallocx_prof(tsd_t *tsd, void *ptr, size_t old_usize, size_t size,
prof_alloc_rollback(tsd, tctx, false);
return usize;
}
prof_realloc(tsd, ptr, usize, tctx, prof_active, false, ptr, old_usize,
prof_realloc(tsd, ptr, usize, tctx, prof_active, ptr, old_usize,
&old_prof_info);
return usize;