Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Mar 2007 22:16:47 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Yar Tikhiy <yar@comp.chem.msu.su>
Cc:        arch@freebsd.org
Subject:   Re: <sys/queue.h> bikeshed proposal 
Message-ID:  <1301.1173997007@critter.freebsd.dk>
In-Reply-To: Your message of "Thu, 15 Mar 2007 16:43:00 %2B0300." <20070315134300.GE28354@comp.chem.msu.su> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20070315134300.GE28354@comp.chem.msu.su>, Yar Tikhiy writes:

>Yeah, <sys/queue.h> can present a challenge in understanding an
>implementation of basic data structures and related algos. :-)
>You thought that tqe_prev points to the whole entry structure when
>making the patch, didn't you?

Nah, I was just generally sleepy I think.

>Personally, I cannot explain to myself why in the double-linked
>structs the prev member points to the next member in the previous
>list element and not to the previous list element itself.  Could
>anybody with CS education explain merits of the current approach?

It allows us to isolate casts to those few backwards functions,
all the forwards functions are type correct.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



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