diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2025-01-11 10:25:27 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2025-01-11 10:26:02 +0100 |
| commit | f489761e682b75ede8754e9f9be48fa29ebaeb10 (patch) | |
| tree | eaa00441feadd61e7f0f291f7dfebd1fd7d3db2d /src/mallochook.c | |
| parent | 56ccde005e9332662326b8446658e7a322633e46 (diff) | |
| download | box64-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.c | 7 |
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 |