mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-30 09:42:27 -05:00
[chore]: Bump github.com/KimMachineGun/automemlimit from 0.4.0 to 0.5.0 (#2560)
This commit is contained in:
parent
4e0488acfe
commit
a858831387
18 changed files with 513 additions and 108 deletions
21
vendor/github.com/pbnjay/memory/memsysctl.go
generated
vendored
Normal file
21
vendor/github.com/pbnjay/memory/memsysctl.go
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// +build darwin freebsd openbsd dragonfly netbsd
|
||||
|
||||
package memory
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func sysctlUint64(name string) (uint64, error) {
|
||||
s, err := syscall.Sysctl(name)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
// hack because the string conversion above drops a \0
|
||||
b := []byte(s)
|
||||
if len(b) < 8 {
|
||||
b = append(b, 0)
|
||||
}
|
||||
return *(*uint64)(unsafe.Pointer(&b[0])), nil
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue