mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
reuse fragment memory
This commit is contained in:
parent
ba0114ad1e
commit
a8b070716d
2 changed files with 6 additions and 4 deletions
|
|
@ -312,7 +312,8 @@ func (f *Fragment) close() error {
|
|||
|
||||
func (f *Fragment) closeStorage() error {
|
||||
// Clear the storage bitmap so it doesn't access the closed mmap.
|
||||
f.storage = roaring.NewBitmap()
|
||||
|
||||
//f.storage = roaring.NewBitmap()
|
||||
|
||||
// Unmap the file.
|
||||
if f.storageData != nil {
|
||||
|
|
|
|||
|
|
@ -617,9 +617,10 @@ func (b *Bitmap) UnmarshalBinary(data []byte) error {
|
|||
|
||||
// Read key count in bytes sizeof(cookie):(sizeof(cookie)+sizeof(uint32)).
|
||||
keyN := binary.LittleEndian.Uint32(data[4:8])
|
||||
b.keys = make([]uint64, keyN)
|
||||
b.containers = make([]*container, keyN)
|
||||
|
||||
if int(keyN) != len(b.keys) {
|
||||
b.keys = make([]uint64, keyN)
|
||||
b.containers = make([]*container, keyN)
|
||||
}
|
||||
headerSize := headerBaseSize
|
||||
|
||||
// Descriptive header section: Read container keys and cardinalities.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue