From 7f5ebd211cd870e9c9a303e6145781bfca58e1bb Mon Sep 17 00:00:00 2001 From: David Goldblatt Date: Sat, 29 Feb 2020 15:07:38 -0800 Subject: [PATCH] Cache bin: set low-water internally. --- include/jemalloc/internal/cache_bin.h | 11 ++++++++++- src/tcache.c | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/jemalloc/internal/cache_bin.h b/include/jemalloc/internal/cache_bin.h index 6ab6baa7..86291748 100644 --- a/include/jemalloc/internal/cache_bin.h +++ b/include/jemalloc/internal/cache_bin.h @@ -160,6 +160,15 @@ cache_bin_low_water_get(cache_bin_t *bin, cache_bin_info_t *info) { return low_water; } +/* + * Indicates that the current cache bin position should be the low water mark + * going forward. + */ +static inline void +cache_bin_low_water_set(cache_bin_t *bin) { + bin->low_water_position = bin->cur_ptr.lowbits; +} + static inline void cache_bin_ncached_set(cache_bin_t *bin, cache_bin_info_t *info, cache_bin_sz_t n) { @@ -289,7 +298,7 @@ cache_bin_init_ptr_array_for_flush(cache_bin_t *bin, cache_bin_info_t *info, } /* - * These accessors are used by the flush pathways -- they reverse ordinary flush + * These accessors are used by the flush pathways -- they reverse ordinary array * ordering. */ JEMALLOC_ALWAYS_INLINE void * diff --git a/src/tcache.c b/src/tcache.c index 48f06b70..a059ecc7 100644 --- a/src/tcache.c +++ b/src/tcache.c @@ -89,7 +89,7 @@ tcache_event_hard(tsd_t *tsd, tcache_t *tcache) { } tcache->bin_refilled[binind] = false; } - tbin->low_water_position = tbin->cur_ptr.lowbits; + cache_bin_low_water_set(tbin); tcache->next_gc_bin++; if (tcache->next_gc_bin == nhbins) {