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:
David Chisnall
2019-04-30 11:49:00 +01:00
parent 95c23b1a00
commit 8bd136c224
7 changed files with 32 additions and 23 deletions

View File

@@ -1211,7 +1211,7 @@ namespace snmalloc
MEASURE_TIME(large_dealloc, 4, 16);
size_t size_bits = bits::next_pow2_bits(size);
size_t rsize = static_cast<size_t>(1) << size_bits;
size_t rsize = bits::one_at_bit(size_bits);
assert(rsize >= SUPERSLAB_SIZE);
size_t large_class = size_bits - SUPERSLAB_BITS;