mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-07 11:58:41 +03:00
fix handling of failing to allocate heap metadata on thread creation, issue #257
This commit is contained in:
parent
32b3608581
commit
5a6d9ba807
2 changed files with 11 additions and 4 deletions
|
@ -816,6 +816,7 @@ void* _mi_malloc_generic(mi_heap_t* heap, size_t size) mi_attr_noexcept
|
|||
if (mi_unlikely(!mi_heap_is_initialized(heap))) {
|
||||
mi_thread_init(); // calls `_mi_heap_init` in turn
|
||||
heap = mi_get_default_heap();
|
||||
if (mi_unlikely(!mi_heap_is_initialized(heap))) { return NULL; }
|
||||
}
|
||||
mi_assert_internal(mi_heap_is_initialized(heap));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue