Improve the failure message upon opt_experimental_infallible_new.
This commit is contained in:
@@ -57,8 +57,14 @@ JEMALLOC_NOINLINE
|
||||
static void *
|
||||
handleOOM(std::size_t size, bool nothrow) {
|
||||
if (opt_experimental_infallible_new) {
|
||||
safety_check_fail("<jemalloc>: Allocation failed and "
|
||||
"opt.experimental_infallible_new is true. Aborting.\n");
|
||||
const char *huge_warning = (size >= ((std::size_t)1 << 30)) ?
|
||||
"This may be caused by heap corruption, if the large size "
|
||||
"is unexpected (suggest building with sanitizers for "
|
||||
"debugging)." : "";
|
||||
|
||||
safety_check_fail("<jemalloc>: Allocation of size %zu failed. "
|
||||
"%s opt.experimental_infallible_new is true. Aborting.\n",
|
||||
size, huge_warning);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user