Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Jan 2002 01:43:02 -0800 (PST)
From:      Julian Elischer <julian@elischer.org>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        Poul-Henning Kamp <phk@critter.freebsd.dk>, Stephen McKay <mckay@thehub.com.au>, John Baldwin <jhb@FreeBSD.ORG>, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, Julian Elischer <julian@FreeBSD.ORG>, Greg Lehey <grog@FreeBSD.ORG>
Subject:   Re: cvs commit: src/share/man/man3 queue.3 
Message-ID:  <Pine.BSF.4.21.0201030138380.22265-100000@InterJet.elischer.org>
In-Reply-To: <200201030919.g039J8v63350@apollo.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help


On Thu, 3 Jan 2002, Matthew Dillon wrote:

> 
> 
>     The issue here is to extend an abstraction up to the point where
>     the compiler can easily optimize it.

Bugger the compiler, I want readable code..
:-)

> 
>     Most of the lists I use are implemented circularly internally,
>     allowing addhead, addtail, insertbefore, insertafter, and remove
>     functions to be implemented with no conditionals.  In this case
>     the terminator is a pointer back to the list head.
> 
>     Now consider a MYLIST_EMPTY() macro verses a MYLIST_GETHEAD()
>     macro.  MYLIST_GETHEAD() would have to check for the terminating
>     condition (a conditional) and return NULL if it's true and the head
>     node if it is false.  MYLIST_EMPTY() simply checks the terminating
>     condition and returns a boolean.  Now consider this code:

I don't understand your point..
TAILQ_FIRST() does not do a conditional to give a NULL on empty..
...#define TAILQ_FIRST(head)       ((head)->tqh_first)





To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0201030138380.22265-100000>