about summary refs log tree commit diff stats
path: root/src/include/debug.h
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2022-07-31 10:32:12 +0200
committerptitSeb <sebastien.chev@gmail.com>2022-08-06 16:10:17 +0200
commit2ac265d52951c2951281b25aa0aba3ad21b6565f (patch)
tree4c8a08922981a5b279a52c1d8bae1bf7218e4e3d /src/include/debug.h
parente261270eb8719a5a2e0c7fd86140390290d49ae9 (diff)
downloadbox64-2ac265d52951c2951281b25aa0aba3ad21b6565f.tar.gz
box64-2ac265d52951c2951281b25aa0aba3ad21b6565f.zip
All box internal memory alloc use __libc_ internal one (except on Android, using libc one gather from dlsym)
Diffstat (limited to 'src/include/debug.h')
-rwxr-xr-xsrc/include/debug.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/include/debug.h b/src/include/debug.h
index 48103d3a..d39ac369 100755
--- a/src/include/debug.h
+++ b/src/include/debug.h
@@ -73,4 +73,22 @@ extern FILE* ftrace;
 #define EXPORTDYN 
 #endif
 
+#ifdef ANDROID
+void init_malloc_hook();
+extern void*(*__libc_malloc)(size_t);
+extern void*(*__libc_realloc)(void*, size_t);
+extern void*(*__libc_calloc)(size_t, size_t);
+extern void (*__libc_free*)(void*);
+#else
+extern void* __libc_malloc(size_t);
+extern void* __libc_realloc(void*, size_t);
+extern void* __libc_calloc(size_t, size_t);
+extern void __libc_free(void*);
+#endif
+#define box_malloc  __libc_malloc
+#define box_realloc __libc_realloc
+#define box_calloc  __libc_calloc
+#define box_free    __libc_free
+extern char* box_strdup(const char* s);
+
 #endif //__DEBUG_H_