diff options
author | Chris Stockton <chrisstocktonaz@gmail.com> | 2018-06-12 15:32:25 -0700 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-06-13 12:59:29 +0900 |
commit | f6d62322eb0ba249d67f4b32ad65c7cb5f209544 (patch) | |
tree | 7bfab45650c5bc9bba59924a6a256931b553bee4 | |
parent | 417f8ba6f54c4010b746d6262eb77683851f1db5 (diff) |
table: arrange fields to reduce padding
This reduces the table.Path size from 88 to 72 which adds up considerably
since it is the most allocated persistent object.
-rw-r--r-- | table/path.go | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/table/path.go b/table/path.go index eaa49bca..246f6aff 100644 --- a/table/path.go +++ b/table/path.go @@ -135,16 +135,17 @@ type Validation struct { } type Path struct { - info *originInfo - IsWithdraw bool - pathAttrs []bgp.PathAttributeInterface - attrsHash uint32 - reason BestPathReason - parent *Path - dels []bgp.BGPAttrType + info *originInfo + parent *Path + pathAttrs []bgp.PathAttributeInterface + dels []bgp.BGPAttrType + attrsHash uint32 + aslooped bool + reason BestPathReason + // For BGP Nexthop Tracking, this field shows if nexthop is invalidated by IGP. IsNexthopInvalid bool - aslooped bool + IsWithdraw bool } func NewPath(source *PeerInfo, nlri bgp.AddrPrefixInterface, isWithdraw bool, pattrs []bgp.PathAttributeInterface, timestamp time.Time, noImplicitWithdraw bool) *Path { |