mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-05 06:59:32 +03:00
set errno ENOMEM for limited arena allocation (issue #295)
This commit is contained in:
parent
9f3c29c642
commit
3228bb685f
1 changed files with 4 additions and 1 deletions
|
@ -197,7 +197,10 @@ void* _mi_arena_alloc_aligned(size_t size, size_t alignment, bool* commit, bool*
|
||||||
}
|
}
|
||||||
|
|
||||||
// finally, fall back to the OS
|
// finally, fall back to the OS
|
||||||
if (mi_option_is_enabled(mi_option_limit_os_alloc)) return NULL;
|
if (mi_option_is_enabled(mi_option_limit_os_alloc)) {
|
||||||
|
errno = ENOMEM;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
*is_zero = true;
|
*is_zero = true;
|
||||||
*memid = MI_MEMID_OS;
|
*memid = MI_MEMID_OS;
|
||||||
void* p = _mi_os_alloc_aligned(size, alignment, *commit, large, tld->stats);
|
void* p = _mi_os_alloc_aligned(size, alignment, *commit, large, tld->stats);
|
||||||
|
|
Loading…
Add table
Reference in a new issue