Add errors for failing to initialise the system.
This commit is contained in:
committed by
Matthew Parkinson
parent
8a8669f957
commit
0b7929327a
@@ -134,6 +134,11 @@ namespace snmalloc
|
||||
|
||||
auto new_body_untyped = PAL::reserve(request_size);
|
||||
|
||||
if (new_body_untyped == nullptr)
|
||||
{
|
||||
PAL::error("Failed to initialisation snmalloc.");
|
||||
}
|
||||
|
||||
#ifdef SNMALLOC_CHECK_CLIENT
|
||||
// Begin pagemap at random offset within the additionally allocated space.
|
||||
static_assert(bits::is_pow2(sizeof(T)), "Next line assumes this.");
|
||||
|
||||
@@ -51,6 +51,12 @@ namespace snmalloc
|
||||
p = ChunkAllocator::alloc_meta_data<T>(
|
||||
h, nullptr, std::forward<Args>(args)...);
|
||||
|
||||
if (p == nullptr)
|
||||
{
|
||||
SharedStateHandle::Backend::Pal::error(
|
||||
"Failed to initialisation thread local allocator.");
|
||||
}
|
||||
|
||||
FlagLock f(pool.lock);
|
||||
p->list_next = pool.list;
|
||||
pool.list = p;
|
||||
|
||||
Reference in New Issue
Block a user