aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Davidson <colrdavidson@gmail.com>2023-01-05 01:37:50 -0800
committerColin Davidson <colrdavidson@gmail.com>2023-01-05 01:37:50 -0800
commitb455ccd2617c91dfa24367abb9b30d2560cf3e57 (patch)
treedc3e92abe2694281c6e22a2744a95d8822365384
parentb22ddb1453c549db951e5cd58e2d50eab3941be0 (diff)
fix more things?
-rw-r--r--core/os/os_windows.odin8
-rw-r--r--core/sys/windows/kernel32.odin2
2 files changed, 5 insertions, 5 deletions
diff --git a/core/os/os_windows.odin b/core/os/os_windows.odin
index cc01f8cca..2bca2fc95 100644
--- a/core/os/os_windows.odin
+++ b/core/os/os_windows.odin
@@ -3,6 +3,7 @@ package os
import win32 "core:sys/windows"
import "core:runtime"
+import "core:intrinsics"
Handle :: distinct uintptr
File_Time :: distinct u64
@@ -128,15 +129,14 @@ get_page_size :: proc() -> int {
get_processor_thread_count :: proc() -> int {
length : c.int = 0
- result := windows.GetLogicalProcessorInformation(nil, &length)
+ result := win32.GetLogicalProcessorInformation(nil, &length)
thread_count := 0
if !result && win32.GetLastError() == 122 && length > 0 {
- processors := make([]windows.SYSTEM_LOGICAL_PROCESSOR_INFORMATION, length, context.temp_allocator)
+ processors := make([]win32.SYSTEM_LOGICAL_PROCESSOR_INFORMATION, length, context.temp_allocator)
- result = windows.GetLogicalProcessorInformation(&processors[0], &length)
+ result = win32.GetLogicalProcessorInformation(&processors[0], &length)
if result {
- core_count := 0
for processor in processors {
if processor.Relationship == windows.RelationProcessorCore {
thread := intrinsics.count_ones(processor.ProcessorMask)
diff --git a/core/sys/windows/kernel32.odin b/core/sys/windows/kernel32.odin
index 7df777da3..2a74ea44e 100644
--- a/core/sys/windows/kernel32.odin
+++ b/core/sys/windows/kernel32.odin
@@ -371,7 +371,7 @@ foreign kernel32 {
lpTotalNumberOfFreeBytes: PULARGE_INTEGER,
) -> BOOL ---
- GetLogicalProcessorInformation :: proc(buffer: ^LOGICAL_PROCESSOR_INFORMATION, returnedLength: PDWORD) -> BOOL ---
+ GetLogicalProcessorInformation :: proc(buffer: ^SYSTEM_LOGICAL_PROCESSOR_INFORMATION, returnedLength: PDWORD) -> BOOL ---
}