This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/7] new queue.h in common/.
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: Pedro Alves <palves at redhat dot com>, gdb-patches at sourceware dot org
- Date: Fri, 07 Dec 2012 15:52:48 +0000
- Subject: Re: [PATCH 1/7] new queue.h in common/.
- References: <1350991620-12950-1-git-send-email-yao@codesourcery.com> <1350991620-12950-2-git-send-email-yao@codesourcery.com> <50B78321.4030201@redhat.com> <50C01825.9060208@codesourcery.com>
On 12/06/2012 03:59 AM, Yao Qi wrote:
> 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).
I see. In that case, please mention that in the function's description.
Thanks,
--
Pedro Alves