No need to pass usize to prof_tctx_set()

This commit is contained in:
Yinan Zhang 2019-12-05 15:15:36 -08:00
parent 1b1e76acfe
commit 5e0b090992
3 changed files with 8 additions and 9 deletions

View File

@ -68,8 +68,8 @@ arena_prof_info_get(tsd_t *tsd, const void *ptr, alloc_ctx_t *alloc_ctx,
} }
JEMALLOC_ALWAYS_INLINE void JEMALLOC_ALWAYS_INLINE void
arena_prof_tctx_set(tsd_t *tsd, const void *ptr, size_t usize, arena_prof_tctx_set(tsd_t *tsd, const void *ptr, alloc_ctx_t *alloc_ctx,
alloc_ctx_t *alloc_ctx, prof_tctx_t *tctx) { prof_tctx_t *tctx) {
cassert(config_prof); cassert(config_prof);
assert(ptr != NULL); assert(ptr != NULL);

View File

@ -50,12 +50,12 @@ prof_info_get(tsd_t *tsd, const void *ptr, alloc_ctx_t *alloc_ctx,
} }
JEMALLOC_ALWAYS_INLINE void JEMALLOC_ALWAYS_INLINE void
prof_tctx_set(tsd_t *tsd, const void *ptr, size_t usize, prof_tctx_set(tsd_t *tsd, const void *ptr, alloc_ctx_t *alloc_ctx,
alloc_ctx_t *alloc_ctx, prof_tctx_t *tctx) { prof_tctx_t *tctx) {
cassert(config_prof); cassert(config_prof);
assert(ptr != NULL); assert(ptr != NULL);
arena_prof_tctx_set(tsd, ptr, usize, alloc_ctx, tctx); arena_prof_tctx_set(tsd, ptr, alloc_ctx, tctx);
} }
JEMALLOC_ALWAYS_INLINE void JEMALLOC_ALWAYS_INLINE void
@ -138,7 +138,7 @@ prof_malloc(tsd_t *tsd, const void *ptr, size_t usize, alloc_ctx_t *alloc_ctx,
if (unlikely((uintptr_t)tctx > (uintptr_t)1U)) { if (unlikely((uintptr_t)tctx > (uintptr_t)1U)) {
prof_malloc_sample_object(tsd, ptr, usize, tctx); prof_malloc_sample_object(tsd, ptr, usize, tctx);
} else { } else {
prof_tctx_set(tsd, ptr, usize, alloc_ctx, prof_tctx_set(tsd, ptr, alloc_ctx,
(prof_tctx_t *)(uintptr_t)1U); (prof_tctx_t *)(uintptr_t)1U);
} }
} }
@ -174,8 +174,7 @@ prof_realloc(tsd_t *tsd, const void *ptr, size_t usize, prof_tctx_t *tctx,
if (unlikely(sampled)) { if (unlikely(sampled)) {
prof_malloc_sample_object(tsd, ptr, usize, tctx); prof_malloc_sample_object(tsd, ptr, usize, tctx);
} else if (moved) { } else if (moved) {
prof_tctx_set(tsd, ptr, usize, NULL, prof_tctx_set(tsd, ptr, NULL, (prof_tctx_t *)(uintptr_t)1U);
(prof_tctx_t *)(uintptr_t)1U);
} else if (unlikely(old_sampled)) { } else if (unlikely(old_sampled)) {
/* /*
* prof_tctx_set() would work for the !moved case as well, but * prof_tctx_set() would work for the !moved case as well, but

View File

@ -182,7 +182,7 @@ prof_alloc_rollback(tsd_t *tsd, prof_tctx_t *tctx, bool updated) {
void void
prof_malloc_sample_object(tsd_t *tsd, const void *ptr, size_t usize, prof_malloc_sample_object(tsd_t *tsd, const void *ptr, size_t usize,
prof_tctx_t *tctx) { prof_tctx_t *tctx) {
prof_tctx_set(tsd, ptr, usize, NULL, tctx); prof_tctx_set(tsd, ptr, NULL, tctx);
/* Get the current time and set this in the extent_t. We'll read this /* Get the current time and set this in the extent_t. We'll read this
* when free() is called. */ * when free() is called. */