From: Thunder from the hill <thunder@lightweight.ods.org>
To: Rik van Riel <riel@conectiva.com.br>
Cc: Lightweight Patch Manager <patch@luckynet.dynu.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Tomas Szepe <szepe@pinerecords.com>, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH][2.5] Single linked lists for Linux,v2
Date: Thu, 26 Sep 2002 00:36:07 -0600 (MDT) [thread overview]
Message-ID: <Pine.LNX.4.44.0209260033420.7827-100000@hawkeye.luckynet.adm> (raw)
In-Reply-To: <Pine.LNX.4.44L.0209252107110.22735-100000@imladris.surriel.com>
Hi,
On Wed, 25 Sep 2002, Rik van Riel wrote:
> > +#define INIT_SLIST_HEAD(name) \
> > + (name->next = name)
> > +
> > +#define SLIST_HEAD(type,name) \
> > + typeof(type) name = INIT_SLIST_HEAD(name)
>
> Fun, so the list head points to itself ...
>
> > +#define slist_for_each(pos, head) \
> > + for (pos = head; pos && ({ prefetch(pos->next); 1; }); \
> > + pos = pos->next)
>
> ... imagine what that would do in combination with this macro.
I'm aware of that possibility. What would you initialize it to, if not the
list itself? (And BTW, anyone have a solution for slist_add()?)
We could set it to NULL, but where would we end?
#define INIT_SLIST_HEAD(name) \
(name->next = NULL)
#define SLIST_HEAD_INIT(name) name
Thunder
--
assert(typeof((fool)->next) == typeof(fool)); /* wrong */
next prev parent reply other threads:[~2002-09-26 6:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-25 22:50 [PATCH][2.5] Single linked lists for Linux,v2 Lightweight Patch Manager
2002-09-25 23:02 ` Thunder from the hill
2002-09-26 0:08 ` Rik van Riel
2002-09-26 6:36 ` Thunder from the hill [this message]
2002-09-26 14:58 ` Rik van Riel
2002-09-26 15:39 ` Thunder from the hill
2002-09-26 16:17 ` Nicolas Pitre
2002-09-26 16:37 ` Rik van Riel
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=Pine.LNX.4.44.0209260033420.7827-100000@hawkeye.luckynet.adm \
--to=thunder@lightweight.ods.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=patch@luckynet.dynu.com \
--cc=riel@conectiva.com.br \
--cc=szepe@pinerecords.com \
/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;
as well as URLs for NNTP newsgroup(s).