From fbca96c4332380c5799dcc804365ac6e93d7db2f Mon Sep 17 00:00:00 2001 From: guangli-dai Date: Sun, 20 Aug 2023 23:28:38 -0700 Subject: [PATCH] Remove unnecessary parameters for cache_bin_postincrement. --- include/jemalloc/internal/cache_bin.h | 3 +-- src/cache_bin.c | 3 +-- src/tcache.c | 3 +-- test/unit/cache_bin.c | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/jemalloc/internal/cache_bin.h b/include/jemalloc/internal/cache_bin.h index 2e95c33c..e6313144 100644 --- a/include/jemalloc/internal/cache_bin.h +++ b/include/jemalloc/internal/cache_bin.h @@ -691,8 +691,7 @@ void cache_bin_info_compute_alloc(cache_bin_info_t *infos, szind_t ninfos, */ void cache_bin_preincrement(cache_bin_info_t *infos, szind_t ninfos, void *alloc, size_t *cur_offset); -void cache_bin_postincrement(cache_bin_info_t *infos, szind_t ninfos, - void *alloc, size_t *cur_offset); +void cache_bin_postincrement(void *alloc, size_t *cur_offset); void cache_bin_init(cache_bin_t *bin, cache_bin_info_t *info, void *alloc, size_t *cur_offset); diff --git a/src/cache_bin.c b/src/cache_bin.c index 362605a8..5fb5607a 100644 --- a/src/cache_bin.c +++ b/src/cache_bin.c @@ -56,8 +56,7 @@ cache_bin_preincrement(cache_bin_info_t *infos, szind_t ninfos, void *alloc, } void -cache_bin_postincrement(cache_bin_info_t *infos, szind_t ninfos, void *alloc, - size_t *cur_offset) { +cache_bin_postincrement(void *alloc, size_t *cur_offset) { *(uintptr_t *)((byte_t *)alloc + *cur_offset) = cache_bin_trailing_junk; *cur_offset += sizeof(void *); diff --git a/src/tcache.c b/src/tcache.c index 914ddb7a..e9cf2ee5 100644 --- a/src/tcache.c +++ b/src/tcache.c @@ -698,8 +698,7 @@ tcache_init(tsd_t *tsd, tcache_slow_t *tcache_slow, tcache_t *tcache, assert(tcache_small_bin_disabled(i, cache_bin)); } - cache_bin_postincrement(tcache_bin_info, nhbins, mem, - &cur_offset); + cache_bin_postincrement(mem, &cur_offset); /* Sanity check that the whole stack is used. */ assert(cur_offset == tcache_bin_alloc_size); } diff --git a/test/unit/cache_bin.c b/test/unit/cache_bin.c index 3b6dbab3..50d51a6d 100644 --- a/test/unit/cache_bin.c +++ b/test/unit/cache_bin.c @@ -93,7 +93,7 @@ test_bin_init(cache_bin_t *bin, cache_bin_info_t *info) { size_t cur_offset = 0; cache_bin_preincrement(info, 1, mem, &cur_offset); cache_bin_init(bin, info, mem, &cur_offset); - cache_bin_postincrement(info, 1, mem, &cur_offset); + cache_bin_postincrement(mem, &cur_offset); assert_zu_eq(cur_offset, size, "Should use all requested memory"); }