Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: <dje@google.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH 1/4] new gdb_queue.h in common/.
Date: Fri, 14 Sep 2012 02:38:00 -0000	[thread overview]
Message-ID: <5052985F.70402@codesourcery.com> (raw)
In-Reply-To: <20562.454.680299.970360@ruffy2.mtv.corp.google.com>

On 09/13/2012 11:54 PM, dje@google.com wrote:
>   > +void									\
>   > +queue_ ## TYPE ## _remove_elem (QUEUE (TYPE) *q,			\
>   > +				QUEUE_ITER (TYPE) *iter)		\
>   > +{									\
>
> gdb_assert (q != NULL);
> gdb_assert (iter != NULL && iter->p != NULL);
>
>   > +  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;					\
>   > +									\
>
> Need to check if q->free_func != NULL and call it on p->data.

We don't have to delete p->data here, because we just remove element, 
and p->data may be used by user later, like function _remove, for 
example.  User has to take care of deleting p->data in his 'operate' 
function.

 > I'm happy with the above nits fixed.

Doug, thanks a lot for your patient review.  Looks queue.h is in shape, 
and I'll post a V2 of this series.

-- 
Yao


  reply	other threads:[~2012-09-14  2:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-24  2:26 [RCF 0/4] A general notification in GDB RSP Yao Qi
2012-08-24  2:26 ` [PATCH 3/4] de-couple %Stop from notification: gdbserver Yao Qi
2012-08-24  2:26 ` [PATCH 2/4] de-couple %Stop from notification: gdb Yao Qi
2012-08-24 16:52   ` Yao Qi
2012-08-24 19:00   ` dje
2012-08-30  6:40     ` Yao Qi
2012-08-24  2:26 ` [PATCH 1/4] new gdb_queue.h in common/ Yao Qi
2012-08-24 18:44   ` dje
2012-08-24 18:49     ` Doug Evans
2012-08-29  9:42     ` Yao Qi
2012-09-04 21:03       ` dje
2012-09-07  2:47         ` Yao Qi
2012-09-10 20:47           ` dje
2012-09-12 14:24             ` Yao Qi
2012-09-13 15:55               ` dje
2012-09-14  2:38                 ` Yao Qi [this message]
2012-09-11 16:50         ` Tom Tromey
2012-08-24  2:26 ` [PATCH 4/4] new notification "TEST" Yao Qi
2012-08-24 17:53 ` [RCF 0/4] A general notification in GDB RSP Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5052985F.70402@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox