Skip to content

Commit

Permalink
Merge pull request sylabs#1751 from preminger/add-missing-cast-in-mem…
Browse files Browse the repository at this point in the history
…oryusage-calculation

fix: add missing cast in memoryusage calculation
  • Loading branch information
preminger authored Jun 12, 2023
2 parents 836ab96 + 1fa1c27 commit d191e3f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
- Fix dropped "n" characters on some platforms in definition file stored as part
of SIF metadata.
- Pass STDIN to `--oci` containers correctly, to fix piping input to a container.
- Fix compilation on 32-bit systems.

## 3.11.3 \[2023-05-04\]

Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,5 @@ The following have contributed code and/or documentation to this repository.
- Yinuo Chen <[email protected]>
- Onur Yılmaz <[email protected]>
- Pranathi Locula <[email protected]>
- Filip Gorczyca <[email protected]>
```
4 changes: 3 additions & 1 deletion internal/app/singularity/instance_linux.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Copyright (c) 2018-2020, Sylabs Inc. All rights reserved.
// Copyright (c) Contributors to the Apptainer project, established as
// Apptainer a Series of LF Projects LLC.
// This software is licensed under a 3-clause BSD license. Please consult the
// LICENSE.md file distributed with the sources of this project regarding your
// rights to use or distribute this software.
Expand Down Expand Up @@ -171,7 +173,7 @@ func calculateMemoryUsage(stats *libcgroups.MemoryStats) (float64, float64, floa
in := &syscall.Sysinfo_t{}
err := syscall.Sysinfo(in)
if err == nil {
memLimit = in.Totalram * uint64(in.Unit)
memLimit = uint64(in.Totalram) * uint64(in.Unit)
}
}
if memLimit != 0 {
Expand Down

0 comments on commit d191e3f

Please sign in to comment.