[tor-dev] RB Trees
* at 0x39b.fr
Sat Jun 25 13:36:49 UTC 2016
I had a discussion with David Goulet about RB trees . More
particularly about the usage of RB trees for some Tor operations like
 or HSDir cache.
David said that Nick wants to use a FreeBSD implementation - is this
one? If it is, I think it could be hard for new contributors like me
to maintain/write/debug code using it. Since inline functions are as
fast as macros , is it conceivable to use functional implementation
instead of macro implementation? If it is, I can propose a generic C
implementation of RB tree.
It seems that Tor uses some kind of hashmap . What about using
hashmaps with RB tree as bucket and thus ensure bounded time complexity?
In some cases, it could be interesting to store RB tree nodes in hashmap
to ensure lookup in O(1) while keeping entries sorted.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 842 bytes
Desc: OpenPGP digital signature
More information about the tor-dev