MCPcopy
hub / github.com/etcd-io/bbolt / munlock

Function munlock

mlock_unix.go:21–36  ·  view source on GitHub ↗

munlock unlocks memory of db file

(db *DB, fileSize int)

Source from the content-addressed store, hash-verified

19
20// munlock unlocks memory of db file
21func munlock(db *DB, fileSize int) error {
22 if db.dataref == nil {
23 return nil
24 }
25
26 sizeToUnlock := fileSize
27 if sizeToUnlock > db.datasz {
28 // Can't unlock more than mmaped slice
29 sizeToUnlock = db.datasz
30 }
31
32 if err := unix.Munlock(db.dataref[:sizeToUnlock]); err != nil {
33 return err
34 }
35 return nil
36}

Callers 1

munlockMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected