summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/malloc.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1999-11-10 20:12:31 +0000
committermillert <millert@openbsd.org>1999-11-10 20:12:31 +0000
commitb1663281409671b9e2b97694287c39dfb3e03618 (patch)
tree9c6ed1b4a748c5bdf83ef1229dce0db116bf055f /lib/libc/stdlib/malloc.c
parentFix typo in printf (diff)
downloadwireguard-openbsd-b1663281409671b9e2b97694287c39dfb3e03618.tar.xz
wireguard-openbsd-b1663281409671b9e2b97694287c39dfb3e03618.zip
calloc() needs to be separate from malloc in case a user wants to have
their own malloc() implementation.
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
-rw-r--r--lib/libc/stdlib/malloc.c26
1 files changed, 1 insertions, 25 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c
index 3582d7980cc..88e25995f39 100644
--- a/lib/libc/stdlib/malloc.c
+++ b/lib/libc/stdlib/malloc.c
@@ -8,7 +8,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: malloc.c,v 1.37 1999/11/09 19:25:33 millert Exp $";
+static char rcsid[] = "$OpenBSD: malloc.c,v 1.38 1999/11/10 20:12:31 millert Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -1278,27 +1278,3 @@ realloc(void *ptr, size_t size)
wrterror("out of memory.\n");
return (r);
}
-
-void *
-calloc(size_t num, size_t size)
-{
- register void *r;
-
- malloc_func = " in calloc():";
- THREAD_LOCK();
- if (malloc_active++) {
- wrtwarning("recursive call.\n");
- malloc_active--;
- return (0);
- }
- size *= num;
- r = imalloc(size);
- if (r && !malloc_zero)
- memset(r, 0, size)
- UTRACE(0, size, r);
- malloc_active--;
- THREAD_UNLOCK();
- if (malloc_xmalloc && !r)
- wrterror("out of memory.\n");
- return (r);
-}