Add error message for failure during init!

This commit is contained in:
Matthew Parkinson
2020-05-19 10:21:00 +01:00
parent 4347701d33
commit 185781ef52

View File

@@ -847,8 +847,12 @@ namespace snmalloc
void init_message_queue()
{
// Manufacture an allocation to prime the queue
// Using an actual allocation removes a conditional of a critical path.
// Using an actual allocation removes a conditional from a critical path.
Remote* dummy = reinterpret_cast<Remote*>(alloc<YesZero>(MIN_ALLOC_SIZE));
if (dummy == nullptr)
{
error("Critical error: Out-of-memory during initialisation.");
}
dummy->set_target_id(id());
message_queue().init(dummy);
}