summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib/malloc.c
diff options
context:
space:
mode:
authorJason Evans <jasone@FreeBSD.org>2006-03-28 22:16:04 +0000
committerJason Evans <jasone@FreeBSD.org>2006-03-28 22:16:04 +0000
commit6b2c15da6a35c2af09e7e753ffc3f527d402a2cf (patch)
tree84a037e2c3045c857b69637dcac7955a8481ae0d /lib/libc/stdlib/malloc.c
parentadb19548bd8c7a0b3883ddd6cb46d20e11fe34c3 (diff)
Notes
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
-rw-r--r--lib/libc/stdlib/malloc.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index 91357a0429fdd..359c98a1416c1 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