@@ -261,3 +261,7 @@ heap_allocator :: proc() -> mem.Allocator {
data = nil,
}
+
+processor_core_count :: proc() -> int {
+ return _processor_core_count()
+}
@@ -772,7 +772,8 @@ get_page_size :: proc() -> int {
return page_size
-get_processor_thread_count :: proc() -> int {
+@(private)
+_processor_core_count :: proc() -> int {
count : int = 0
count_size := size_of(count)
if _sysctlbyname("hw.logicalcpu", &count, &count_size, nil, 0) == 0 {
@@ -703,7 +703,8 @@ get_page_size :: proc() -> int {
@@ -879,9 +879,9 @@ get_page_size :: proc() -> int {
- thread_count := int(_unix_get_nprocs())
- return thread_count
+ return int(_unix_get_nprocs())
_alloc_command_line_arguments :: proc() -> []string {
@@ -706,9 +706,10 @@ get_page_size :: proc() -> int {
_SC_NPROCESSORS_ONLN :: 503
- thread_count := int(_sysconf(_SC_NPROCESSORS_ONLN))
+ return int(_sysconf(_SC_NPROCESSORS_ONLN))
@@ -89,7 +89,10 @@ seek :: proc(fd: Handle, offset: i64, whence: int) -> (i64, Errno) {
current_thread_id :: proc "contextless" () -> int {
return 0
-
+ return 1
file_size :: proc(fd: Handle) -> (i64, Errno) {
stat, err := wasi.fd_filestat_get(wasi.fd_t(fd))
@@ -127,7 +127,8 @@ get_page_size :: proc() -> int {
length : c.int = 0
result := win32.GetLogicalProcessorInformation(nil, &length)
@@ -149,7 +150,6 @@ get_processor_thread_count :: proc() -> int {
return thread_count
exit :: proc "contextless" (code: int) -> ! {
runtime._cleanup_runtime_contextless()
win32.ExitProcess(win32.DWORD(code))