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

@@ -117,7 +117,7 @@ namespace snmalloc
static constexpr size_t BUCKETS = 1 << BUCKETS_BITS;
static constexpr size_t TOTAL_BUCKETS =
bits::to_exp_mant_const<BUCKETS_BITS>(
(static_cast<size_t>(1) << (bits::ADDRESS_BITS - 1)));
bits::one_at_bit(bits::ADDRESS_BITS - 1));
Stats sizeclass[N];
Stats large[LARGE_N];