about summary refs log tree commit diff stats
path: root/src/mallochook.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-01-11 10:25:27 +0100
committerptitSeb <sebastien.chev@gmail.com>2025-01-11 10:26:02 +0100
commitf489761e682b75ede8754e9f9be48fa29ebaeb10 (patch)
treeeaa00441feadd61e7f0f291f7dfebd1fd7d3db2d /src/mallochook.c
parent56ccde005e9332662326b8446658e7a322633e46 (diff)
downloadbox64-f489761e682b75ede8754e9f9be48fa29ebaeb10.tar.gz
box64-f489761e682b75ede8754e9f9be48fa29ebaeb10.zip
[BOX32] Improved elf memory managment for 32bits process
Diffstat (limited to 'src/mallochook.c')
-rw-r--r--src/mallochook.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mallochook.c b/src/mallochook.c
index ebd7a017..8094ca37 100644
--- a/src/mallochook.c
+++ b/src/mallochook.c
@@ -236,6 +236,13 @@ size_t box32_malloc_usable_size(void* p)
     else
         return box_malloc_usable_size(p);
 }
+
+char* box32_strdup(const char* s) {
+    char* ret = box32_calloc(1, strlen(s)+1);
+    memcpy(ret, s, strlen(s));
+    return ret;
+}
+
 #endif
 
 // redefining all libc memory allocation routines