cache_bin nflush -> n.

We're going to use it on the fill pathway as well.
This commit is contained in:
David Goldblatt 2020-02-26 17:39:55 -08:00 committed by David Goldblatt
parent 74d36d78ef
commit d303f30796
2 changed files with 6 additions and 5 deletions

View File

@ -255,16 +255,16 @@ cache_bin_dalloc_easy(cache_bin_t *bin, void *ptr) {
typedef struct cache_bin_ptr_array_s cache_bin_ptr_array_t;
struct cache_bin_ptr_array_s {
cache_bin_sz_t nflush;
cache_bin_sz_t n;
void **ptr;
};
#define CACHE_BIN_PTR_ARRAY_DECLARE(name, nflush_val) \
#define CACHE_BIN_PTR_ARRAY_DECLARE(name, nval) \
cache_bin_ptr_array_t name; \
name.nflush = (nflush_val)
name.n = (nval)
static inline void
cache_bin_ptr_array_init(cache_bin_ptr_array_t *arr, cache_bin_t *bin,
cache_bin_ptr_array_init_for_flush(cache_bin_ptr_array_t *arr, cache_bin_t *bin,
cache_bin_sz_t nflush, szind_t ind, cache_bin_info_t *infos) {
arr->ptr = cache_bin_empty_position_get(bin, ind, infos) - 1;
assert(cache_bin_ncached_get(bin, ind, infos) == 0

View File

@ -182,7 +182,8 @@ tcache_bin_flush_impl(tsd_t *tsd, tcache_t *tcache, cache_bin_t *tbin,
VARIABLE_ARRAY(edata_t *, item_edata, nflush + 1);
CACHE_BIN_PTR_ARRAY_DECLARE(ptrs, nflush);
cache_bin_ptr_array_init(&ptrs, tbin, nflush, binind, tcache_bin_info);
cache_bin_ptr_array_init_for_flush(&ptrs, tbin, nflush, binind,
tcache_bin_info);
/* Look up edata once per item. */
if (config_opt_safety_checks) {