about summary refs log tree commit diff stats
path: root/src/custommem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/custommem.c')
-rw-r--r--src/custommem.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/custommem.c b/src/custommem.c
index 1a729fe9..7e73a23d 100644
--- a/src/custommem.c
+++ b/src/custommem.c
@@ -1300,6 +1300,9 @@ void setProtection(uintptr_t addr, size_t size, uint32_t prot)
 
 void setProtection_mmap(uintptr_t addr, size_t size, uint32_t prot)
 {
+    if(!size)
+        return;
+    size = (size+box64_pagesize-1)&~(box64_pagesize-1); // round size
     mutex_lock(&mutex_prot);
     addMapMem(mmapmem, addr, addr+size-1);
     mutex_unlock(&mutex_prot);