Re: <sys/queue.h> bikeshed proposal



In message <20070315134300.GE28354@xxxxxxxxxxxxxxxx>, 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@xxxxxxxxxxx | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"