mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-04 22:49:32 +03:00
Fix error: cannot use 'throw' with exceptions disabled #815, by @sergio-nsk
This commit is contained in:
parent
cc4500a024
commit
944ec1ab8a
1 changed files with 4 additions and 0 deletions
|
@ -908,9 +908,13 @@ static bool mi_try_new_handler(bool nothrow) {
|
|||
#endif
|
||||
if (h==NULL) {
|
||||
_mi_error_message(ENOMEM, "out of memory in 'new'");
|
||||
#if defined(_CPPUNWIND) || defined(__cpp_exceptions) // exceptions are not always enabled
|
||||
if (!nothrow) {
|
||||
throw std::bad_alloc();
|
||||
}
|
||||
#else
|
||||
MI_UNUSED(nothrow);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Reference in a new issue