diff options
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
-rw-r--r-- | lib/libc/stdlib/malloc.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index 91357a0..359c98a 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -3489,6 +3489,26 @@ free(void *ptr) */ /******************************************************************************/ /* + * Begin non-standard functions. + */ + +size_t +malloc_usable_size(const void *ptr) +{ + + assert(ptr != NULL); + + if (ptr == &nil) + return (0); + else + return (isalloc(ptr)); +} + +/* + * End non-standard functions. + */ +/******************************************************************************/ +/* * Begin library-private functions, used by threading libraries for protection * of malloc during fork(). These functions are only called if the program is * running in threaded mode, so there is no need to check whether the program |