Store ncached_max * ptr_size in tcache_bin_info.
With the cache bin metadata switched to pointers, ncached_max is usually accessed and timed by sizeof(ptr). Store the results in tcache_bin_info for direct access, and add a helper function for the ncached_max value.
This commit is contained in:
@@ -10,7 +10,7 @@ TEST_BEGIN(test_cache_bin) {
|
||||
|
||||
assert_ptr_not_null(stack, "Unexpected mallocx failure");
|
||||
/* Initialize to empty; bin 0. */
|
||||
cache_bin_sz_t ncached_max = tcache_bin_info[0].ncached_max;
|
||||
cache_bin_sz_t ncached_max = cache_bin_ncached_max_get(0);
|
||||
void **empty_position = stack + ncached_max;
|
||||
bin->cur_ptr.ptr = empty_position;
|
||||
bin->low_water_position = bin->cur_ptr.lowbits;
|
||||
|
Reference in New Issue
Block a user