mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 00:55:55 +00:00
cleanup on unmarshall shrink
This commit is contained in:
parent
1eb2f8d568
commit
641519acf2
1 changed files with 4 additions and 0 deletions
|
|
@ -622,6 +622,10 @@ func (b *Bitmap) UnmarshalBinary(data []byte) error {
|
|||
b.keys = make([]uint64, 0, keyN)
|
||||
b.containers = make([]*container, 0, keyN)
|
||||
} else if int(keyN) < len(b.keys) { //shrink
|
||||
// nil out to allow to be GCed
|
||||
for i := range b.containers[keyN:] {
|
||||
b.containers[int(keyN)+i] = nil
|
||||
}
|
||||
b.keys = b.keys[:keyN]
|
||||
b.containers = b.containers[:keyN]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue