superslab: reorder initialization
Setting kind and then immediately testing it seems wrong.
This commit is contained in:
@@ -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++)
|
||||
|
||||
Reference in New Issue
Block a user