1 /* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
2 This file was then part of the GNU C Library. */
4 /* Copyright (c) 2010. The SimGrid Team.
5 * All rights reserved. */
7 /* This program is free software; you can redistribute it and/or modify it
8 * under the terms of the license (GNU LGPL) which comes with this package. */
10 #include <sys/types.h> /* GCC on HP/UX needs this before string.h. */
11 #include <string.h> /* Prototypes for memcpy, memmove, memset, etc */
13 #include "mmprivate.h"
15 /* Allocate an array of NMEMB elements each SIZE bytes long.
16 The entire array is initialized to zeros. */
18 void *mcalloc(void *md, register size_t nmemb, register size_t size)
20 register void *result;
22 if ((result = mmalloc(md, nmemb * size)) != NULL) {
23 memset(result, 0, nmemb * size);