From 93fc3be3dfd87245e4d30acd68e143e284f9bfd2 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Wed, 10 Sep 2025 15:44:29 +0200 Subject: [BOX32] More work on box32 memory management and threads --- src/os/os_linux.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/os/os_linux.c') diff --git a/src/os/os_linux.c b/src/os/os_linux.c index d1a940b5..5c1ccac4 100644 --- a/src/os/os_linux.c +++ b/src/os/os_linux.c @@ -10,6 +10,8 @@ #include #include #include +#include +#include #include "os.h" #include "signals.h" @@ -133,6 +135,16 @@ const char* GetNativeName(void* p) void PersonalityAddrLimit32Bit(void) { personality(ADDR_LIMIT_32BIT); + /*struct rlimit l; + if(getrlimit(RLIMIT_DATA, &l)<0) return; // failed + if(l.rlim_max>3*1024*1024*1024LL) { + l.rlim_cur = 3*1024*1024*1024LL; + setrlimit(RLIMIT_DATA, &l); + }*/ + // setting 32bits malloc options + mallopt(M_ARENA_TEST, 2); + mallopt(M_ARENA_MAX, 2); + mallopt(M_MMAP_THRESHOLD, 128*1024); } int IsAddrElfOrFileMapped(uintptr_t addr) -- cgit 1.4.1