Remove all instances of static_cast<size_t>(1).
In preparation for removing magic numbers, simplify code that is computing masks with a single bit set.
This commit is contained in:
@@ -30,8 +30,7 @@ namespace snmalloc
|
||||
bits::from_exp_mant<INTERMEDIATE_BITS, MIN_ALLOC_BITS>(sizeclass);
|
||||
|
||||
size_t alignment = bits::min(
|
||||
static_cast<size_t>(1) << bits::ctz_const(size[sizeclass]),
|
||||
OS_PAGE_SIZE);
|
||||
bits::one_at_bit(bits::ctz_const(size[sizeclass])), OS_PAGE_SIZE);
|
||||
cache_friendly_mask[sizeclass] = (alignment - 1);
|
||||
inverse_cache_friendly_mask[sizeclass] = ~(alignment - 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user