From 33c92cc991a39ab073af8e13a7393d10efdf2fcb Mon Sep 17 00:00:00 2001 From: dimok789 Date: Tue, 11 Oct 2016 21:01:53 +0200 Subject: [PATCH] compile fix --- crt/memory.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/crt/memory.c b/crt/memory.c index 6cd0b5b..e2fa8fb 100644 --- a/crt/memory.c +++ b/crt/memory.c @@ -1,6 +1,7 @@ #include #include #include +#include #include void * @@ -30,31 +31,31 @@ __wrap_realloc(void *ptr, size_t size) { if (!ptr) { return __wrap_malloc(size); } - + if (__wrap_malloc_usable_size(ptr) >= size) { return ptr; } - + void *realloc_ptr = __wrap_malloc(size); - + if(!realloc_ptr) { return NULL; } - + memcpy(realloc_ptr, ptr, __wrap_malloc_usable_size(ptr)); __wrap_free(ptr); - + return realloc_ptr; } void * __wrap_calloc(size_t num, size_t size) { void *ptr = __wrap_malloc(num*size); - + if(ptr) { memset(ptr, 0, num*size); } - + return ptr; }