mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
more windows kerfuffle
This commit is contained in:
@@ -4,6 +4,7 @@ package os
|
|||||||
import win32 "core:sys/windows"
|
import win32 "core:sys/windows"
|
||||||
import "core:runtime"
|
import "core:runtime"
|
||||||
import "core:intrinsics"
|
import "core:intrinsics"
|
||||||
|
import "core:c"
|
||||||
|
|
||||||
Handle :: distinct uintptr
|
Handle :: distinct uintptr
|
||||||
File_Time :: distinct u64
|
File_Time :: distinct u64
|
||||||
@@ -139,7 +140,7 @@ _processor_core_count :: proc() -> int {
|
|||||||
result = win32.GetLogicalProcessorInformation(&processors[0], &length)
|
result = win32.GetLogicalProcessorInformation(&processors[0], &length)
|
||||||
if result {
|
if result {
|
||||||
for processor in processors {
|
for processor in processors {
|
||||||
if processor.Relationship == windows.RelationProcessorCore {
|
if processor.Relationship == win32.RelationProcessorCore {
|
||||||
thread := intrinsics.count_ones(processor.ProcessorMask)
|
thread := intrinsics.count_ones(processor.ProcessorMask)
|
||||||
thread_count += thread
|
thread_count += thread
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1043,7 +1043,7 @@ DUMMYUNIONNAME_u :: struct #raw_union {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SYSTEM_LOGICAL_PROCESSOR_INFORMATION :: struct {
|
SYSTEM_LOGICAL_PROCESSOR_INFORMATION :: struct {
|
||||||
ProcessorMask: ULONGPTR,
|
ProcessorMask: ULONG_PTR,
|
||||||
Relationship: LOGICAL_PROCESSOR_RELATIONSHIP,
|
Relationship: LOGICAL_PROCESSOR_RELATIONSHIP,
|
||||||
DummyUnion: DUMMYUNIONNAME_u,
|
DummyUnion: DUMMYUNIONNAME_u,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user