/* General queue data structure for GDB, the GNU debugger.
- Copyright (C) 2012-2015 Free Software Foundation, Inc.
+ Copyright (C) 2012-2017 Free Software Foundation, Inc.
This file is part of GDB.
void \
queue_ ## TYPE ## _enque (QUEUE (TYPE) *q, TYPE v) \
{ \
- QUEUE_ELEM (TYPE) *p \
- = xmalloc (sizeof (QUEUE_ELEM (TYPE))); \
+ QUEUE_ELEM (TYPE) *p = XNEW (QUEUE_ELEM (TYPE)); \
\
gdb_assert (q != NULL); \
p->data = v; \
QUEUE (TYPE) * \
queue_ ## TYPE ## _alloc (void (*free_func) (TYPE)) \
{ \
- QUEUE (TYPE) *q; \
+ QUEUE (TYPE) *q = XNEW (QUEUE (TYPE)); \
\
- q = (QUEUE (TYPE) *) xmalloc (sizeof (QUEUE (TYPE))); \
q->head = NULL; \
q->tail = NULL; \
q->free_func = free_func; \