b7e3a0da86
Release Tag / release (push) Successful in 34s
- Added metrics for bytes saved from cache to improve performance insights. - Updated cache eviction strategies in MemoryFS and DiskFS to include metrics tracking for hits and evictions. - Enhanced README.md with updated garbage collection algorithm descriptions and recommendations for cache usage. - Introduced new madviseSequential functionality for improved memory access hints on Unix systems. - Adjusted validation configuration in examples to better reflect realistic usage scenarios.
14 lines
309 B
Go
14 lines
309 B
Go
//go:build !windows
|
|
|
|
package disk
|
|
|
|
import (
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
// madviseSequential gives the OS a hint that the memory region will be
|
|
// accessed sequentially. This is a no-op or best-effort on some platforms.
|
|
func madviseSequential(b []byte) error {
|
|
return unix.Madvise(b, unix.MADV_SEQUENTIAL)
|
|
}
|