• Jon Maloy's avatar
    tipc: replace name table service range array with rb tree · 218527fe
    Jon Maloy authored
    The current design of the binding table has an unnecessary memory
    consuming and complex data structure. It aggregates the service range
    items into an array, which is expanded by a factor two every time it
    becomes too small to hold a new item. Furthermore, the arrays never
    shrink when the number of ranges diminishes.
    
    We now replace this array with an RB tree that is holding the range
    items as tree nodes, each range directly holding a list of bindings.
    
    This, along with a few name changes, improves both readability and
    volume of the code, as well as reducing memory consumption and hopefully
    improving cache hit rate.
    Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    218527fe
name_table.c 26.7 KB