Fix CPU count detection in FreeBSD & NetBSD

This commit is contained in:
Feoramund committed 2024-09-11 08:39:23 -04:00
1 parent b1db33b519
commit 2938655a3d
3 files changed
+12 -4

No files matched your search

+1 -1
View File
@@ -978,7 +978,7 @@ get_page_size :: proc() -> int {
_processor_core_count :: proc() -> int {
count : int = 0
count_size := size_of(count)
if _sysctlbyname("hw.logicalcpu", &count, &count_size, nil, 0) == 0 {
if _sysctlbyname("hw.ncpu", &count, &count_size, nil, 0) == 0 {
if count > 0 {
return count
}