summaryrefslogtreecommitdiffhomepage
path: root/table/table.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-08-02 00:16:33 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-08-02 00:16:33 +0900
commit07196197675c07c712eba0c24a934dcbe20783e4 (patch)
treef2f08f2606040b90e3f2abe2960f2160d4b93145 /table/table.go
parent15f598ad8e5be47725cc7aea31c80e38e346c408 (diff)
table: allocate bitmap for path id dynamically
allocating 256 bytes per prefix isn't a good idea. Let's allocate 8 bytes by default and expand dynamically if necessary. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'table/table.go')
-rw-r--r--table/table.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/table/table.go b/table/table.go
index 6e423808..01bf6349 100644
--- a/table/table.go
+++ b/table/table.go
@@ -217,10 +217,7 @@ func (t *Table) getOrCreateDest(nlri bgp.AddrPrefixInterface) *Destination {
"Topic": "Table",
"Key": tableKey,
}).Debugf("create Destination")
- dest = NewDestination(nlri)
- dest.localIdMap = NewBitmap(2048)
- // the id zero means id is not allocated yet.
- dest.localIdMap.Flag(0)
+ dest = NewDestination(nlri, 64)
t.setDestination(tableKey, dest)
}
return dest