From 46338173744a36df3755b49d065372efb1d5f104 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sat, 17 Feb 2024 12:44:18 +0100 Subject: Small optim to speedup mmap64 --- src/custommem.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src') 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) -- cgit 1.4.1