You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perhaps a refactoring of the splay tree ( splay_node_t) node would be a good idea.
Basically if you put the splay_node_t struct minus the data pointer as a member in the struct being inserted you would:
Reduce pointer indirection (minor)
Be able to local the splay_node_t without performing a search from the subnet cache (good for /32 removal)
It would be best if splay_* functions become macros referencing the named struct to enforce this (safe) usage splay_insert_node(subnet_tree, subnet, splay_global). Getting the data pointer from splay_node_t can be done with offsetof and contained within a helper macro.
There may be other improvements outside of the subnet system as well as splay_node_t is used in many places.
For an example of what I mean using the subnet_t usage of the splay tree:
Perhaps a refactoring of the splay tree (
splay_node_t
) node would be a good idea.Basically if you put the
splay_node_t
struct minus the data pointer as a member in the struct being inserted you would:splay_node_t
without performing a search from the subnet cache (good for /32 removal)It would be best if
splay_*
functions become macros referencing the named struct to enforce this (safe) usagesplay_insert_node(subnet_tree, subnet, splay_global)
. Getting the data pointer fromsplay_node_t
can be done with offsetof and contained within a helper macro.There may be other improvements outside of the subnet system as well as
splay_node_t
is used in many places.For an example of what I mean using the
subnet_t
usage of the splay tree:Where
splay_node_t
is:The text was updated successfully, but these errors were encountered: