diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2025-05-26 20:41:18 +0200 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2025-05-26 20:41:18 +0200 |
| commit | eac58fc640241e6683b6f6bb469092832e287995 (patch) | |
| tree | c015ab6e48ccb1c36d5a6c89ee9e7743ecd08649 /core/sys/info | |
| parent | 0f0d69ea4c4fe6efa9d9e9cdf97f571e9dce8f82 (diff) | |
sys/info: populate cpu.physical_cores and cpu.logical_cores on Darwin
Diffstat (limited to 'core/sys/info')
| -rw-r--r-- | core/sys/info/cpu_darwin.odin | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/sys/info/cpu_darwin.odin b/core/sys/info/cpu_darwin.odin new file mode 100644 index 000000000..c4a209f6d --- /dev/null +++ b/core/sys/info/cpu_darwin.odin @@ -0,0 +1,12 @@ +package sysinfo + +import "core:sys/unix" + +@(init, private) +init_cpu_core_count :: proc "contextless" () { + physical, logical: i64 + unix.sysctlbyname("hw.physicalcpu", &physical) + unix.sysctlbyname("hw.logicalcpu", &logical) + cpu.physical_cores = int(physical) + cpu.logical_cores = int(logical) +} |