diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2024-02-17 12:44:18 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2024-02-17 12:44:18 +0100 |
| commit | 46338173744a36df3755b49d065372efb1d5f104 (patch) | |
| tree | d3df96b0ae36137e8f12d2a8c7c13f77296ab48b /src | |
| parent | a190910cbf962b42a86237ef5cc6b1919261d172 (diff) | |
| download | box64-46338173744a36df3755b49d065372efb1d5f104.tar.gz box64-46338173744a36df3755b49d065372efb1d5f104.zip | |
Small optim to speedup mmap64
Diffstat (limited to 'src')
| -rw-r--r-- | src/custommem.c | 7 |
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) |