Bug fix for using failing to initialise meta-data

If the Superslab meta-data is larger than an OS page, then the
subsequent pages could be decommited. This removes the skipped
initialisation in that case.
This commit is contained in:
Matthew Parkinson
2020-11-09 21:16:35 +00:00
committed by Matthew Parkinson
parent 8990c34911
commit 01b282a5f3

View File

@@ -81,7 +81,10 @@ namespace snmalloc
{
allocator = alloc;
if (kind != Super)
// If Superslab is larger than a page, then we cannot guarantee it still
// has a valid layout as the subsequent pages could have been freed and
// zeroed, hence only skip initialisation if smaller.
if (kind != Super || (sizeof(Superslab) >= OS_PAGE_SIZE))
{
if (kind != Fresh)
{