corepower: Fix identify method for multi-cpu-package systems
[dragonfly.git] / contrib / ldns / compat / calloc.c
blobc86b956757f1231ac401a4f0714e9a66b05e8404
1 /* Just a replacement, if the original malloc is not
2 GNU-compliant. See autoconf documentation. */
4 #if HAVE_CONFIG_H
5 #include <ldns/config.h>
6 #endif
8 void *calloc();
10 #if !HAVE_BZERO && HAVE_MEMSET
11 # define bzero(buf, bytes) ((void) memset (buf, 0, bytes))
12 #endif
14 void *
15 calloc(size_t num, size_t size)
17 void *new = malloc(num * size);
18 if (!new) {
19 return NULL;
21 bzero(new, num * size);
22 return new;