This commit is contained in:
Matthew Parkinson
2019-04-26 16:32:39 +01:00
committed by Matthew Parkinson
parent 8eb6e36966
commit c471e1a271
4 changed files with 13 additions and 10 deletions

View File

@@ -984,11 +984,11 @@ namespace snmalloc
stats().sizeclass_alloc(sizeclass);
SlabList* sc = &small_classes[sizeclass];
SlabLink* link = sc->get_head();
Slab* slab;
if (~(uintptr_t)link != 0)
if (!sc->is_empty())
{
SlabLink* link = sc->get_head();
slab = link->get_slab();
}
else

View File

@@ -51,8 +51,6 @@ namespace snmalloc
private:
static constexpr size_t COVERED_BITS =
bits::ADDRESS_BITS - GRANULARITY_BITS;
static constexpr size_t POINTER_BITS =
bits::next_pow2_bits_const(sizeof(void*));
static constexpr size_t CONTENT_BITS =
bits::next_pow2_bits_const(sizeof(T));