Threshold is no longer updated before prof_realloc()
This commit is contained in:
parent
7e3671911f
commit
055478cca8
@ -132,14 +132,14 @@ prof_malloc(tsd_t *tsd, const void *ptr, size_t usize, alloc_ctx_t *alloc_ctx,
|
|||||||
|
|
||||||
JEMALLOC_ALWAYS_INLINE void
|
JEMALLOC_ALWAYS_INLINE void
|
||||||
prof_realloc(tsd_t *tsd, const void *ptr, size_t usize, prof_tctx_t *tctx,
|
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) {
|
prof_info_t *old_prof_info) {
|
||||||
bool sampled, old_sampled, moved;
|
bool sampled, old_sampled, moved;
|
||||||
|
|
||||||
cassert(config_prof);
|
cassert(config_prof);
|
||||||
assert(ptr != NULL || (uintptr_t)tctx <= (uintptr_t)1U);
|
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));
|
assert(usize == isalloc(tsd_tsdn(tsd), ptr));
|
||||||
if (prof_sample_accum_update(tsd, usize, true)) {
|
if (prof_sample_accum_update(tsd, usize, true)) {
|
||||||
/*
|
/*
|
||||||
|
@ -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);
|
*usize = isalloc(tsd_tsdn(tsd), p);
|
||||||
}
|
}
|
||||||
prof_realloc(tsd, p, *usize, tctx, prof_active, false, old_ptr,
|
prof_realloc(tsd, p, *usize, tctx, prof_active, old_ptr, old_usize,
|
||||||
old_usize, &old_prof_info);
|
&old_prof_info);
|
||||||
|
|
||||||
return p;
|
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);
|
prof_alloc_rollback(tsd, tctx, false);
|
||||||
return usize;
|
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);
|
&old_prof_info);
|
||||||
|
|
||||||
return usize;
|
return usize;
|
||||||
|
Loading…
Reference in New Issue
Block a user