SIZE bytes long. */
extern void *mrealloc(xbt_mheap_t md, void *ptr, size_t size);
-/* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */
-extern void *mcalloc(xbt_mheap_t md, size_t nmemb, size_t size);
-
/* Free a block allocated by `mmalloc', `mrealloc' or `mcalloc'. */
extern void mfree(xbt_mheap_t md, void *ptr);
+++ /dev/null
-/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
- This file was then part of the GNU C Library. */
-
-/* Copyright (c) 2010. The SimGrid Team.
- * All rights reserved. */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include <sys/types.h> /* GCC on HP/UX needs this before string.h. */
-#include <string.h> /* Prototypes for memcpy, memmove, memset, etc */
-
-#include "mmprivate.h"
-
-/* Allocate an array of NMEMB elements each SIZE bytes long.
- The entire array is initialized to zeros. */
-
-void *mcalloc(xbt_mheap_t md, register size_t nmemb, register size_t size)
-{
- register void *result;
-
- if ((result = mmalloc(md, nmemb * size)) != NULL) {
- memset(result, 0, nmemb * size);
- }
- return (result);
-}
xbt_mheap_t mdp = __mmalloc_current_heap ?: (xbt_mheap_t) mmalloc_preinit();
LOCK(mdp);
- void *ret = mcalloc(mdp, nmemb,size);
+ void *ret = mmalloc(mdp, nmemb*size);
UNLOCK(mdp);
+ memset(ret, 0, nmemb * size);
+
return ret;
}