From 35d29fcb08fadaf006561a058746b0fce76a6a74 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Thu, 18 Jul 2002 15:00:07 +0000 Subject: Miles Bader implemented a new mmap based malloc which is much smarter than the old "malloc-simple", and actually works, unlike the old "malloc". So kill the old "malloc-simple" and the old "malloc" and replace them with Miles' new malloc implementation. Update Config files to match. Thanks Miles! --- libc/stdlib/malloc/calloc.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 libc/stdlib/malloc/calloc.c (limited to 'libc/stdlib/malloc/calloc.c') diff --git a/libc/stdlib/malloc/calloc.c b/libc/stdlib/malloc/calloc.c new file mode 100644 index 000000000..6231edb46 --- /dev/null +++ b/libc/stdlib/malloc/calloc.c @@ -0,0 +1,32 @@ +/* + * libc/stdlib/malloc-zarg/calloc.c -- calloc function + * + * Copyright (C) 2002 NEC Corporation + * Copyright (C) 2002 Miles Bader + * + * This file is subject to the terms and conditions of the GNU Lesser + * General Public License. See the file COPYING.LIB in the main + * directory of this archive for more details. + * + * Written by Miles Bader + */ + +#include +#include + +#include "malloc.h" + + +void * +calloc (size_t size, size_t num) +{ + void *mem; + + size *= num; + + mem = malloc (size); + if (mem) + memset (mem, 0, size); + + return mem; +} -- cgit v1.2.3