about summary refs log tree commit diff stats
path: root/src/custommem.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2022-03-06 16:27:19 +0100
committerptitSeb <sebastien.chev@gmail.com>2022-03-06 16:27:19 +0100
commite517e5877659a5669113401ab12df2936c11c3f1 (patch)
tree4101ba2d9b75330aad2435c84f5b17553d51bf2a /src/custommem.c
parentd2cb088918b139ece64d3d7eab670a560e236d80 (diff)
downloadbox64-e517e5877659a5669113401ab12df2936c11c3f1.tar.gz
box64-e517e5877659a5669113401ab12df2936c11c3f1.zip
Improved speed of mmap changes
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 359725ea..b653e78b 100644
--- a/src/custommem.c
+++ b/src/custommem.c
@@ -940,6 +940,8 @@ void allocProtection(uintptr_t addr, size_t size, uint32_t prot)
 
 void loadProtectionFromMap()
 {
+    if(box64_mapclean)
+        return;
     char buf[500];
     FILE *f = fopen("/proc/self/maps", "r");
     if(!f)
@@ -955,6 +957,7 @@ void loadProtectionFromMap()
         }
     }
     fclose(f);
+    box64_mapclean = 1;
 }
 
 static int blockempty(uint8_t* mem)