superslab: reorder initialization

Setting kind and then immediately testing it seems wrong.
This commit is contained in:
Nathaniel Filardo
2019-05-14 14:07:08 +01:00
parent cbeeba004b
commit 7251022e24

View File

@@ -82,12 +82,6 @@ namespace snmalloc
if (kind != Super)
{
// If this wasn't previously a Superslab, we need to set up the
// header.
kind = Super;
// Point head at the first non-short slab.
head = 1;
if (kind != Fresh)
{
// If this wasn't previously Fresh, we need to zero some things.
@@ -97,6 +91,13 @@ namespace snmalloc
new (&(meta[i])) Metaslab();
}
}
// If this wasn't previously a Superslab, we need to set up the
// header.
kind = Super;
// Point head at the first non-short slab.
head = 1;
#ifndef NDEBUG
auto curr = head;
for (size_t i = 0; i < SLAB_COUNT - used - 1; i++)