This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/7] new queue.h in common/.


On 11/29/2012 11:45 PM, Pedro Alves wrote:

>+									\
>+  if (iter->p == q->head || iter->p == q->tail)			\
>+    {									\
>+      if (iter->p == q->head)						\
>+	q->head = iter->p->next;					\
>+      if (iter->p == q->tail)						\
>+	q->tail = iter->prev;						\
>+    }									\
>+  else									\
>+    iter->prev->next = iter->p->next;					\
>+									\
>+  xfree (iter->p);							\
Don't we need to call free_func ?


Pedro,
We leave the caller to take care of the data in queue element. The caller may take data out of queue (/wo free) or may delete the data (/w free).


The rest of comments will be address in V4.

--
Yao (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]