]> git.proxmox.com Git - mirror_frr.git/commit - ldpd/neighbor.c
lib: improve the RB implementation
authorRafael Zalamena <rzalamena@gmail.com>
Fri, 16 Jun 2017 13:44:31 +0000 (10:44 -0300)
committerRafael Zalamena <rzalamena@gmail.com>
Fri, 16 Jun 2017 13:44:31 +0000 (10:44 -0300)
commit45926e58749924a6ff207cf211de3e6457578ecc
tree36fc6b1e0f38826a3cc809e77e39d54c0588832a
parentf43cd318b26a3dc57a0e6f40bcccdd5ce1886432
lib: improve the RB implementation

Switch the RB tree implementation completely to the new dlg@'s version
that uses pre-declared functions instead of macros for tree functions.

Original e-mail/diff:
https://marc.info/?l=openbsd-tech&m=147087487111068&w=2

Pros:

* Reduces the amount of code that the usage of those macros generate
* Allows the compiler to do a better compile-time check job
* Might have better i-cache utilization since the tree code is shared

Con:

* dlg@ benchmarks shows it has 'very slightly slower' insertions
* imported RB_* code must adapt the following calls:
  RB_INIT(), RB_GENERATE(), RB_ROOT(), RB_EMPTY(), make compare
  functions use 'const' (if not already) and maybe others.
15 files changed:
ldpd/adjacency.c
ldpd/interface.c
ldpd/l2vpn.c
ldpd/lde.c
ldpd/lde_lib.c
ldpd/ldp_vty_conf.c
ldpd/ldpd.c
ldpd/ldpe.c
ldpd/neighbor.c
lib/Makefile.am
lib/ns.c
lib/openbsd-tree.c [new file with mode: 0644]
lib/openbsd-tree.h
lib/vrf.c
zebra/zebra_rib.c