Skip to content

Commit

Permalink
Merge pull request #151 from noctarius/main
Browse files Browse the repository at this point in the history
syscall.Sysinfo returns an uint32 on linux/arm, but uint64 otherwise
  • Loading branch information
extemporalgenome authored Sep 28, 2023
2 parents 91d974d + 62791c2 commit a1904d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion procstats/linux/memory_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ func readSysinfoMemoryLimit() (limit uint64, err error) {
var sysinfo syscall.Sysinfo_t

if err = syscall.Sysinfo(&sysinfo); err == nil {
limit = uint64(sysinfo.Unit) * sysinfo.Totalram
// syscall.Sysinfo returns an uint32 on linux/arm, but uint64 otherwise
limit = uint64(sysinfo.Unit) * uint64(sysinfo.Totalram)
}

return
Expand Down

0 comments on commit a1904d6

Please sign in to comment.