mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
shuffle to private/public wrapper
This commit is contained in:
@@ -261,3 +261,7 @@ heap_allocator :: proc() -> mem.Allocator {
|
|||||||
data = nil,
|
data = nil,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
processor_core_count :: proc() -> int {
|
||||||
|
return _processor_core_count()
|
||||||
|
}
|
||||||
|
|||||||
@@ -772,7 +772,8 @@ get_page_size :: proc() -> int {
|
|||||||
return page_size
|
return page_size
|
||||||
}
|
}
|
||||||
|
|
||||||
get_processor_thread_count :: proc() -> int {
|
@(private)
|
||||||
|
_processor_core_count :: proc() -> int {
|
||||||
count : int = 0
|
count : int = 0
|
||||||
count_size := size_of(count)
|
count_size := size_of(count)
|
||||||
if _sysctlbyname("hw.logicalcpu", &count, &count_size, nil, 0) == 0 {
|
if _sysctlbyname("hw.logicalcpu", &count, &count_size, nil, 0) == 0 {
|
||||||
|
|||||||
@@ -703,7 +703,8 @@ get_page_size :: proc() -> int {
|
|||||||
return page_size
|
return page_size
|
||||||
}
|
}
|
||||||
|
|
||||||
get_processor_thread_count :: proc() -> int {
|
@(private)
|
||||||
|
_processor_core_count :: proc() -> int {
|
||||||
count : int = 0
|
count : int = 0
|
||||||
count_size := size_of(count)
|
count_size := size_of(count)
|
||||||
if _sysctlbyname("hw.logicalcpu", &count, &count_size, nil, 0) == 0 {
|
if _sysctlbyname("hw.logicalcpu", &count, &count_size, nil, 0) == 0 {
|
||||||
|
|||||||
@@ -879,9 +879,9 @@ get_page_size :: proc() -> int {
|
|||||||
return page_size
|
return page_size
|
||||||
}
|
}
|
||||||
|
|
||||||
get_processor_thread_count :: proc() -> int {
|
@(private)
|
||||||
thread_count := int(_unix_get_nprocs())
|
_processor_core_count :: proc() -> int {
|
||||||
return thread_count
|
return int(_unix_get_nprocs())
|
||||||
}
|
}
|
||||||
|
|
||||||
_alloc_command_line_arguments :: proc() -> []string {
|
_alloc_command_line_arguments :: proc() -> []string {
|
||||||
|
|||||||
@@ -706,9 +706,10 @@ get_page_size :: proc() -> int {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_SC_NPROCESSORS_ONLN :: 503
|
_SC_NPROCESSORS_ONLN :: 503
|
||||||
get_processor_thread_count :: proc() -> int {
|
|
||||||
thread_count := int(_sysconf(_SC_NPROCESSORS_ONLN))
|
@(private)
|
||||||
return thread_count
|
_processor_core_count :: proc() -> int {
|
||||||
|
return int(_sysconf(_SC_NPROCESSORS_ONLN))
|
||||||
}
|
}
|
||||||
|
|
||||||
_alloc_command_line_arguments :: proc() -> []string {
|
_alloc_command_line_arguments :: proc() -> []string {
|
||||||
|
|||||||
@@ -89,7 +89,10 @@ seek :: proc(fd: Handle, offset: i64, whence: int) -> (i64, Errno) {
|
|||||||
current_thread_id :: proc "contextless" () -> int {
|
current_thread_id :: proc "contextless" () -> int {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
@(private)
|
||||||
|
_processor_core_count :: proc() -> int {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
file_size :: proc(fd: Handle) -> (i64, Errno) {
|
file_size :: proc(fd: Handle) -> (i64, Errno) {
|
||||||
stat, err := wasi.fd_filestat_get(wasi.fd_t(fd))
|
stat, err := wasi.fd_filestat_get(wasi.fd_t(fd))
|
||||||
|
|||||||
@@ -127,7 +127,8 @@ get_page_size :: proc() -> int {
|
|||||||
return page_size
|
return page_size
|
||||||
}
|
}
|
||||||
|
|
||||||
get_processor_thread_count :: proc() -> int {
|
@(private)
|
||||||
|
_processor_core_count :: proc() -> int {
|
||||||
length : c.int = 0
|
length : c.int = 0
|
||||||
result := win32.GetLogicalProcessorInformation(nil, &length)
|
result := win32.GetLogicalProcessorInformation(nil, &length)
|
||||||
|
|
||||||
@@ -149,7 +150,6 @@ get_processor_thread_count :: proc() -> int {
|
|||||||
return thread_count
|
return thread_count
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
exit :: proc "contextless" (code: int) -> ! {
|
exit :: proc "contextless" (code: int) -> ! {
|
||||||
runtime._cleanup_runtime_contextless()
|
runtime._cleanup_runtime_contextless()
|
||||||
win32.ExitProcess(win32.DWORD(code))
|
win32.ExitProcess(win32.DWORD(code))
|
||||||
|
|||||||
Reference in New Issue
Block a user