BUG: /lib/lists.c.. Don`t use -O2 . Use -O1
Martin Mares
mj at ucw.cz
Sun Jan 13 01:12:20 CET 2013
Hello!
> MJ, any comment on this list code and pointer aliasing?
I have also convinced myself that the code is correct.
However, as the years go, I more and more feel that saving a single
pointer in the list head is not worth the trickiness it takes.
My more recent programs mostly use a different implementation,
based on circular doubly-linked lists. It requires 4 pointers in
the list head (as opposed to 3 pointers in BIRD's lib/lists.c) and
2 pointers per list node. Its semantics is easier to follow and
the list operations are easier and some of them even faster.
Maybe BIRD could switch to these lists, soo.
You can see them in action in LibUCW repository
(git://git.ucw.cz/libucw.git, http://www.ucw.cz/gitweb/?p=libucw.git;a=summary),
ucw/clists.h.
(Some other bits of LibUCW might be interesting to BIRD, but beware,
several LibUCW modules depend on GCC extensions.)
Have a nice fortnight
--
Martin `MJ' Mares <mj at ucw.cz> http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
Outside of a dog, a book is man's best friend. Inside a dog, it's too dark to read.
More information about the Bird-users
mailing list