about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-03-17 17:17:27 +0100
committerptitSeb <sebastien.chev@gmail.com>2025-03-17 17:17:27 +0100
commit87327b182f6fd6eefd2620e0b1775e3fedd33459 (patch)
tree797f012d4c0b9d8d8546831aa0b059d39b14a440 /src
parent5b9951e1bd54a21e4c00aba314d8adf8b2ba0f22 (diff)
downloadbox64-87327b182f6fd6eefd2620e0b1775e3fedd33459.tar.gz
box64-87327b182f6fd6eefd2620e0b1775e3fedd33459.zip
This should fix non-Dynarec build
Diffstat (limited to 'src')
-rw-r--r--src/custommem.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/custommem.c b/src/custommem.c
index b2a9098e..b686e091 100644
--- a/src/custommem.c
+++ b/src/custommem.c
@@ -835,32 +835,6 @@ size_t customGetUsableSize(void* p)
     return 0;
 }
 
-#ifdef DYNAREC
-#define NCHUNK          64
-typedef struct mapchunk_s {
-    blocklist_t         chunk;
-    rbtree_t*           tree;
-} mapchunk_t;
-typedef struct mmaplist_s {
-    mapchunk_t          chunks[NCHUNK];
-    mmaplist_t*         next;
-} mmaplist_t;
-
-dynablock_t* FindDynablockFromNativeAddress(void* p)
-{
-    if(!p)
-        return NULL;
-    
-    uintptr_t addr = (uintptr_t)p;
-
-    mapchunk_t* bl = (mapchunk_t*)rb_get_64(rbt_dynmem, (uintptr_t)p);
-    if(bl) {
-        dynablock_t** ret = (dynablock_t**)rb_get_64(bl->tree, (uintptr_t)p);
-        if(ret) return *ret;
-    }
-    return NULL;
-}
-
 void* box32_dynarec_mmap(size_t size)
 {
 #ifdef BOX32
@@ -887,6 +861,32 @@ void* box32_dynarec_mmap(size_t size)
     return MAP_FAILED;
 }
 
+#ifdef DYNAREC
+#define NCHUNK          64
+typedef struct mapchunk_s {
+    blocklist_t         chunk;
+    rbtree_t*           tree;
+} mapchunk_t;
+typedef struct mmaplist_s {
+    mapchunk_t          chunks[NCHUNK];
+    mmaplist_t*         next;
+} mmaplist_t;
+
+dynablock_t* FindDynablockFromNativeAddress(void* p)
+{
+    if(!p)
+        return NULL;
+    
+    uintptr_t addr = (uintptr_t)p;
+
+    mapchunk_t* bl = (mapchunk_t*)rb_get_64(rbt_dynmem, (uintptr_t)p);
+    if(bl) {
+        dynablock_t** ret = (dynablock_t**)rb_get_64(bl->tree, (uintptr_t)p);
+        if(ret) return *ret;
+    }
+    return NULL;
+}
+
 #ifdef TRACE_MEMSTAT
 static uint64_t dynarec_allocated = 0;
 #endif