From 44b903f97ac7e818ec623f8886aa984439ecbe6c Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 18 May 2019 13:51:19 -0400 Subject: [PATCH] rpmalloc: Disable ASLR for heap areas. On 32-bit at least, our ASLR is too aggressive and fragments the address space very quickly to the point where at 500MB (1/4) usage, area insertion begins to fail. --- src/system/libroot/posix/rpmalloc/rpmalloc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/libroot/posix/rpmalloc/rpmalloc.cpp b/src/system/libroot/posix/rpmalloc/rpmalloc.cpp index aeddc71349..0b2ffc765d 100644 --- a/src/system/libroot/posix/rpmalloc/rpmalloc.cpp +++ b/src/system/libroot/posix/rpmalloc/rpmalloc.cpp @@ -1716,7 +1716,7 @@ _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, (_memory_huge_pages ? VM_FLAGS_SUPERPAGE_SIZE_2MB : -1), 0); # elif defined(__HAIKU__) void* ptr; - area_id area = create_area("heap area", &ptr, B_RANDOMIZED_ANY_ADDRESS, + area_id area = create_area("heap area", &ptr, B_ANY_ADDRESS, size + padding, B_NO_LOCK, B_READ_AREA | B_WRITE_AREA); if (area < 0) ptr = MAP_FAILED;