diff options
Diffstat (limited to 'gdb/defs.h')
-rw-r--r-- | gdb/defs.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -844,10 +844,11 @@ extern void xmfree (void *md, void *ptr); "libiberty.h". */ extern void xfree (void *); -/* Utility macro to allocate typed memory. Avoids errors like +/* Utility macros to allocate typed memory. Avoids errors like ``struct foo *foo = xmalloc (sizeof bar)'' and ``struct foo *foo = (struct foo *) xmalloc (sizeof bar)''. */ #define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE))) +#define XCALLOC(NMEMB, TYPE) ((TYPE*) xcalloc ((NMEMB), sizeof (TYPE))) /* Like asprintf/vasprintf but get an internal_error if the call fails. */ |