Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions bolt_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
package bbolt

import (
"fmt"
"syscall"
"time"
"unsafe"
Expand Down Expand Up @@ -58,13 +57,6 @@ func mmap(db *DB, sz int) error {
return err
}

// Advise the kernel that the mmap is accessed randomly.
err = unix.Madvise(b, syscall.MADV_RANDOM)
if err != nil && err != syscall.ENOSYS {
// Ignore not implemented error in kernel because it still works.
return fmt.Errorf("madvise: %s", err)
}

// Save the original byte slice and convert to a byte array pointer.
db.dataref = b
db.data = (*[maxMapSize]byte)(unsafe.Pointer(&b[0]))
Expand Down