about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-02-17 12:44:18 +0100
committerptitSeb <sebastien.chev@gmail.com>2024-02-17 12:44:18 +0100
commit46338173744a36df3755b49d065372efb1d5f104 (patch)
treed3df96b0ae36137e8f12d2a8c7c13f77296ab48b /src
parenta190910cbf962b42a86237ef5cc6b1919261d172 (diff)
downloadbox64-46338173744a36df3755b49d065372efb1d5f104.tar.gz
box64-46338173744a36df3755b49d065372efb1d5f104.zip
Small optim to speedup mmap64
Diffstat (limited to 'src')
-rw-r--r--src/custommem.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/custommem.c b/src/custommem.c
index 7fe6ebfd..fd22929d 100644
--- a/src/custommem.c
+++ b/src/custommem.c
@@ -1221,14 +1221,11 @@ void setProtection_mmap(uintptr_t addr, size_t size, uint32_t prot)
     size = ALIGN(size);
     LOCK_PROT();
     rb_set(mmapmem, addr, addr+size, 1);
+    if(!prot)
+        rb_set(mapallmem, addr, addr+size, 1);
     UNLOCK_PROT();
     if(prot)
         setProtection(addr, size, prot);
-    else {
-        LOCK_PROT();
-        rb_set(mapallmem, addr, addr+size, 1);
-        UNLOCK_PROT();
-    }
 }
 
 void setProtection_elf(uintptr_t addr, size_t size, uint32_t prot)