-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(systemMemorySizeMb): Improve system memory detection on BSD systems
- Added support for detecting total system memory on FreeBSD, OpenBSD, and NetBSD using `sysctl`. - Updated `systemMemorySizeMb()` to use `unsigned long` instead of `int` for better accuracy, especially on systems with large amounts of RAM. - Introduced a `constexpr unsigned long megabyte` to improve readability and avoid redundant calculations. - Unified memory detection logic for BSD systems, using `HW_PHYSMEM64` when available for better precision. Fixes incorrect memory reporting on BSD platforms where it previously returned `-1`.
- Loading branch information
1 parent
6b4ffb3
commit 455c9dd
Showing
4 changed files
with
28 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters