aboutsummaryrefslogtreecommitdiff
path: root/gdb/common/queue.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/common/queue.h')
-rw-r--r--gdb/common/queue.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/gdb/common/queue.h b/gdb/common/queue.h
index fce4349..99459a0 100644
--- a/gdb/common/queue.h
+++ b/gdb/common/queue.h
@@ -125,8 +125,7 @@ QUEUE(TYPE) \
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; \
@@ -229,9 +228,8 @@ queue_ ## TYPE ## _iterate (QUEUE (TYPE) *q, \
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; \