From 5e0b090992ba4399b65c177cd30d56cc69c96646 Mon Sep 17 00:00:00 2001 From: Yinan Zhang Date: Thu, 5 Dec 2019 15:15:36 -0800 Subject: [PATCH] No need to pass usize to prof_tctx_set() --- include/jemalloc/internal/arena_inlines_b.h | 4 ++-- include/jemalloc/internal/prof_inlines_b.h | 11 +++++------ src/prof.c | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/jemalloc/internal/arena_inlines_b.h b/include/jemalloc/internal/arena_inlines_b.h index 6ec1a123..fb25c8f8 100644 --- a/include/jemalloc/internal/arena_inlines_b.h +++ b/include/jemalloc/internal/arena_inlines_b.h @@ -68,8 +68,8 @@ arena_prof_info_get(tsd_t *tsd, const void *ptr, alloc_ctx_t *alloc_ctx, } JEMALLOC_ALWAYS_INLINE void -arena_prof_tctx_set(tsd_t *tsd, const void *ptr, size_t usize, - alloc_ctx_t *alloc_ctx, prof_tctx_t *tctx) { +arena_prof_tctx_set(tsd_t *tsd, const void *ptr, alloc_ctx_t *alloc_ctx, + prof_tctx_t *tctx) { cassert(config_prof); assert(ptr != NULL); diff --git a/include/jemalloc/internal/prof_inlines_b.h b/include/jemalloc/internal/prof_inlines_b.h index 827476d1..06689c8a 100644 --- a/include/jemalloc/internal/prof_inlines_b.h +++ b/include/jemalloc/internal/prof_inlines_b.h @@ -50,12 +50,12 @@ prof_info_get(tsd_t *tsd, const void *ptr, alloc_ctx_t *alloc_ctx, } JEMALLOC_ALWAYS_INLINE void -prof_tctx_set(tsd_t *tsd, const void *ptr, size_t usize, - alloc_ctx_t *alloc_ctx, prof_tctx_t *tctx) { +prof_tctx_set(tsd_t *tsd, const void *ptr, alloc_ctx_t *alloc_ctx, + prof_tctx_t *tctx) { cassert(config_prof); 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 @@ -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)) { prof_malloc_sample_object(tsd, ptr, usize, tctx); } else { - prof_tctx_set(tsd, ptr, usize, alloc_ctx, + prof_tctx_set(tsd, ptr, alloc_ctx, (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)) { prof_malloc_sample_object(tsd, ptr, usize, tctx); } else if (moved) { - prof_tctx_set(tsd, ptr, usize, NULL, - (prof_tctx_t *)(uintptr_t)1U); + prof_tctx_set(tsd, ptr, NULL, (prof_tctx_t *)(uintptr_t)1U); } else if (unlikely(old_sampled)) { /* * prof_tctx_set() would work for the !moved case as well, but diff --git a/src/prof.c b/src/prof.c index 9c2357c8..d0c06a8a 100644 --- a/src/prof.c +++ b/src/prof.c @@ -182,7 +182,7 @@ prof_alloc_rollback(tsd_t *tsd, prof_tctx_t *tctx, bool updated) { void prof_malloc_sample_object(tsd_t *tsd, const void *ptr, size_t usize, 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 * when free() is called. */