Merge pull request #108 from benbjohnson/remove-mmap-resizing

Remove post-mmap resizing
This commit is contained in:
tgruben 2016-09-01 12:06:38 -05:00 committed by GitHub
commit 361c5fbeb4
2 changed files with 2 additions and 3 deletions

View file

@ -711,8 +711,7 @@ func (cmd *InspectCommand) Run() error {
t := time.Now()
fmt.Fprintf(cmd.Stderr, "unmarshaling bitmap...")
bm := roaring.NewBitmap()
buf := (*[0x7FFFFFFF]byte)(unsafe.Pointer(&data[0]))[:fi.Size()]
if err := bm.UnmarshalBinary(buf); err != nil {
if err := bm.UnmarshalBinary(data); err != nil {
return err
}
fmt.Fprintf(cmd.Stderr, " (%s)\n", time.Since(t))

View file

@ -191,7 +191,7 @@ func (f *Fragment) openStorage() error {
}
// Attach the mmap file to the bitmap.
data := (*[0x7FFFFFFF]byte)(unsafe.Pointer(&f.storageData[0]))[:fi.Size()]
data := f.storageData
if err := f.storage.UnmarshalBinary(data); err != nil {
return fmt.Errorf("unmarshal storage: file=%s, err=%s", f.file.Name(), err)
}