From fb683851b1af8bd49198f6706a86adee95acd713 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Fri, 17 May 2019 16:35:58 -0400 Subject: [PATCH] rpmalloc: Disable assert on failing to map memory. We want applications to be able to handle out-of-memory conditions gracefully, not just trigger an assert every time. I disabled this before, looks like I missed it in the final patch. --- src/system/libroot/posix/rpmalloc/rpmalloc.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/system/libroot/posix/rpmalloc/rpmalloc.cpp b/src/system/libroot/posix/rpmalloc/rpmalloc.cpp index 0be1619220..aeddc71349 100644 --- a/src/system/libroot/posix/rpmalloc/rpmalloc.cpp +++ b/src/system/libroot/posix/rpmalloc/rpmalloc.cpp @@ -1726,7 +1726,9 @@ _memory_map_os(size_t size, size_t* offset) { void* ptr = mmap(0, size + padding, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_UNINITIALIZED, -1, 0); # endif if ((ptr == MAP_FAILED) || !ptr) { +#ifndef __HAIKU__ assert("Failed to map virtual memory block" == 0); +#endif return 0; } #endif