Date: Thu, 4 Jan 2001 22:25:19 +0000 From: Tony Finch <dot@dotat.at> To: Kirk McKusick <mckusick@mckusick.com> Cc: Alfred Perlstein <bright@wintelcom.net>, Will Andrews <will@physics.purdue.edu>, Peter Wemm <peter@netplex.com.au>, Stephen McKay <mckay@thehub.com.au>, phk@FreeBSD.ORG, arch@FreeBSD.ORG Subject: Re: Reinstatement of CIRCLEQ Message-ID: <20010104222519.Y2140@hand.dotat.at> In-Reply-To: <200101041708.JAA05731@beastie.mckusick.com> References: <20010104001943.T292@fw.wintelcom.net> <200101041708.JAA05731@beastie.mckusick.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Kirk McKusick <mckusick@mckusick.com> wrote: > From: Alfred Perlstein <bright@wintelcom.net> > > You're right, I'm wondering though, would it be possible > to change TAILQ_PREV(elm, headname, field) to TAILQ_PREV(elm, > field) by using the offset of 'field' into the struct? > You could subtract the offset of 'field' from the tqe_prev > of the next struct right? > >You are correct that your suggested change is exactly the >unportability/headache that I am trying to avoid. The Apache Group needed a linked list structure that would allow insertions before and after a given element without knowing the address of the list header. Although I wanted to use sys/queue.h it didn't quite have that functionality so I wrote some "ring" macros based on code by Dean Gaudet. http://www.apache.org/websrc/cvsweb.cgi/~checkout~/apr-util/include/ap_ring.h?rev=1.5&content-type=text/plain Tony. -- f.a.n.finch fanf@covalent.net dot@dotat.at "You realize there's a government directive stating that there is no such thing as a flying saucer?" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010104222519.Y2140>