mirror of
https://github.com/go-gitea/gitea.git
synced 2025-10-19 15:11:48 +00:00
Update to last common bleve (#3986)
This commit is contained in:

committed by
Lunny Xiao

parent
1b7cd3d0b0
commit
917b9641ec
24
vendor/github.com/tinylib/msgp/msgp/advise_linux.go
generated
vendored
Normal file
24
vendor/github.com/tinylib/msgp/msgp/advise_linux.go
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
// +build linux,!appengine
|
||||
|
||||
package msgp
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func adviseRead(mem []byte) {
|
||||
syscall.Madvise(mem, syscall.MADV_SEQUENTIAL|syscall.MADV_WILLNEED)
|
||||
}
|
||||
|
||||
func adviseWrite(mem []byte) {
|
||||
syscall.Madvise(mem, syscall.MADV_SEQUENTIAL)
|
||||
}
|
||||
|
||||
func fallocate(f *os.File, sz int64) error {
|
||||
err := syscall.Fallocate(int(f.Fd()), 0, 0, sz)
|
||||
if err == syscall.ENOTSUP {
|
||||
return f.Truncate(sz)
|
||||
}
|
||||
return err
|
||||
}
|
Reference in New Issue
Block a user