diff --git a/src/mem/alloc.h b/src/mem/alloc.h index b008e61..24b9e13 100644 --- a/src/mem/alloc.h +++ b/src/mem/alloc.h @@ -842,8 +842,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(alloc(MIN_ALLOC_SIZE)); + if (dummy == nullptr) + { + error("Critical error: Out-of-memory during initialisation."); + } dummy->set_target_id(id()); message_queue().init(dummy); }