diff options
Diffstat (limited to 'src/malloc/oldmalloc/malloc_usable_size.c')
-rw-r--r-- | src/malloc/oldmalloc/malloc_usable_size.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/malloc/oldmalloc/malloc_usable_size.c b/src/malloc/oldmalloc/malloc_usable_size.c new file mode 100644 index 00000000..672b518a --- /dev/null +++ b/src/malloc/oldmalloc/malloc_usable_size.c @@ -0,0 +1,9 @@ +#include <malloc.h> +#include "malloc_impl.h" + +hidden void *(*const __realloc_dep)(void *, size_t) = realloc; + +size_t malloc_usable_size(void *p) +{ + return p ? CHUNK_SIZE(MEM_TO_CHUNK(p)) - OVERHEAD : 0; +} |