4 ms·
You don't always need preprocessor tricks to generate a special purpose red-black tree, you can use an intrusive variant like this: http://cgit.osmocom.org/libo
by noselasd 13y ago
You don't always need preprocessor tricks to generate a special purpose red-black tree, you can use an intrusive variant like this: http://cgit.osmocom.org/libosmocore/tree/include/osmocom/core/linuxrbtree.h http://cgit.osmocom.org/libosmocore/tree/include/osmocom/cor.... This works together with the container_of macro: http://stackoverflow.com/questions/15832301/understanding-container-of-macro-in-linux-kernel http://stackoverflow.com/questions/15832301/understanding-co...
In similar spirit, the linked list variant: http://cgit.osmocom.org/libosmocore/tree/include/osmocom/core/linuxlist.h http://cgit.osmocom.org/libosmocore/tree/include/osmocom/cor..., though the macros in sys/queue.h are also useful for linked lists.