Skip to content

Commit

Permalink
add mips compability
Browse files Browse the repository at this point in the history
  • Loading branch information
klychka committed Oct 11, 2021
1 parent 63525a6 commit 0efecb9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bolt_mipsle.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package bolt

import (
"syscall"
"unsafe"
)

// maxMapSize represents the largest mmap size supported by Bolt.
const maxMapSize = 0x40000000 // 1GB

Expand All @@ -8,3 +13,12 @@ const maxAllocSize = 0xFFFFFFF

// brokenUnaligned Are unaligned load/stores broken on this arch?
var brokenUnaligned = false

// NOTE: This function is copied from stdlib because it is not available on darwin.
func madvise(b []byte, advice int) (err error) {
_, _, e1 := syscall.Syscall(syscall.SYS_MADVISE, uintptr(unsafe.Pointer(&b[0])), uintptr(len(b)), uintptr(advice))
if e1 != 0 {
err = e1
}
return
}

0 comments on commit 0efecb9

Please sign in to comment.