mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
add get core count
This commit is contained in:
@@ -404,6 +404,7 @@ foreign libc {
|
||||
@(link_name="__errno_location") __errno_location :: proc() -> ^int ---
|
||||
|
||||
@(link_name="getpagesize") _unix_getpagesize :: proc() -> c.int ---
|
||||
@(link_name="get_nprocs") _unix_get_nprocs :: proc() -> c.int ---
|
||||
@(link_name="fdopendir") _unix_fdopendir :: proc(fd: Handle) -> Dir ---
|
||||
@(link_name="closedir") _unix_closedir :: proc(dirp: Dir) -> c.int ---
|
||||
@(link_name="rewinddir") _unix_rewinddir :: proc(dirp: Dir) ---
|
||||
@@ -878,6 +879,10 @@ get_page_size :: proc() -> int {
|
||||
return page_size
|
||||
}
|
||||
|
||||
get_processor_thread_count :: proc() -> int {
|
||||
thread_count := int(_unix_get_nprocs())
|
||||
return thread_count
|
||||
}
|
||||
|
||||
_alloc_command_line_arguments :: proc() -> []string {
|
||||
res := make([]string, len(runtime.args__))
|
||||
|
||||
Reference in New Issue
Block a user