about summary refs log tree commit diff stats
path: root/src/emu/x64emu.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-01-23 15:56:11 +0100
committerptitSeb <sebastien.chev@gmail.com>2024-01-23 15:56:11 +0100
commitbc852aebeb9852801329f9576b4d5e3fa7df2efa (patch)
treeafa5f6e29bc226eb993b8d5972d533442734f42f /src/emu/x64emu.c
parent89da530898fa08c23b59e3e3bf64f266f113e014 (diff)
downloadbox64-bc852aebeb9852801329f9576b4d5e3fa7df2efa.tar.gz
box64-bc852aebeb9852801329f9576b4d5e3fa7df2efa.zip
Added a new option BOX64_MMAP32 to use 32bits mapping on external MMAP (help Snapdragon device running Vulkan with Wine/Wow64, active by default on SD845/SD888/SD8G2 profiles)
Diffstat (limited to 'src/emu/x64emu.c')
-rw-r--r--src/emu/x64emu.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/emu/x64emu.c b/src/emu/x64emu.c
index 0173ea22..d1ae11c8 100644
--- a/src/emu/x64emu.c
+++ b/src/emu/x64emu.c
@@ -31,9 +31,6 @@
 #warning Architecture cannot follow SSE Flush to 0 flag
 #endif
 
-// from src/wrapped/wrappedlibc.c
-int my_munmap(x64emu_t* emu, void* addr, unsigned long length);
-
 typedef struct cleanup_s {
     void*       f;
     int         arg;
@@ -194,8 +191,10 @@ void CallAllCleanup(x64emu_t *emu)
 
 static void internalFreeX64(x64emu_t* emu)
 {
-    if(emu && emu->stack2free)
-        my_munmap(NULL, emu->stack2free, emu->size_stack);
+    if(emu && emu->stack2free) {
+        if(!internal_munmap(emu->stack2free, emu->size_stack))
+            freeProtection((uintptr_t)emu->stack2free, emu->size_stack);
+    }
 }
 
 EXPORTDYN