Added error message to Windows Pal using VirtualAlloc. (#44)

This commit is contained in:
Matthew Parkinson
2019-05-08 17:10:53 +01:00
committed by GitHub
parent 8d5432c559
commit 3c9fe1041a

View File

@@ -217,7 +217,12 @@ namespace snmalloc
if (committed)
flags |= MEM_COMMIT;
return VirtualAlloc(nullptr, *size, flags, PAGE_READWRITE);
void* ret = VirtualAlloc(nullptr, *size, flags, PAGE_READWRITE);
if (ret == nullptr)
{
error("Failed to allocate memory\n");
}
return ret;
}
# endif
};