| ... | @@ -3896,3 +3896,23 @@ pub const MIN = struct { | ... | @@ -3896,3 +3896,23 @@ pub const MIN = struct { |
| 3896 | | 3896 | |
| 3897 | pub extern "c" fn mincore(addr: *align(std.mem.page_size) const anyopaque, length: usize, vec: [*]u8) c_int; | 3897 | pub extern "c" fn mincore(addr: *align(std.mem.page_size) const anyopaque, length: usize, vec: [*]u8) c_int; |
| 3898 | pub extern "c" fn os_proc_available_memory() usize; | 3898 | pub extern "c" fn os_proc_available_memory() usize; |
| | 3899 | |
| | 3900 | pub const thread_affinity_policy = extern struct { |
| | 3901 | tag: integer_t, |
| | 3902 | }; |
| | 3903 | |
| | 3904 | pub const thread_policy_flavor_t = natural_t; |
| | 3905 | pub const thread_policy_t = [*]integer_t; |
| | 3906 | pub const thread_affinity_policy_data_t = thread_affinity_policy; |
| | 3907 | pub const thread_affinity_policy_t = [*]thread_affinity_policy; |
| | 3908 | |
| | 3909 | pub const THREAD_AFFINITY = struct { |
| | 3910 | pub const POLICY = 0; |
| | 3911 | pub const POLICY_COUNT = @intCast(mach_msg_type_number_t, @sizeOf(thread_affinity_policy_data_t) / @sizeOf(integer_t)); |
| | 3912 | }; |
| | 3913 | |
| | 3914 | /// cpu affinity api |
| | 3915 | /// albeit it is also available on arm64, it always fails as in this architecture there is no sense of |
| | 3916 | /// individual cpus (high performance cpus group and low consumption one), thus the pthread QOS api is more appropriate in this case. |
| | 3917 | pub extern "c" fn thread_affinity_get(thread: thread_act_t, flavor: thread_policy_flavor_t, info: thread_policy_t, infocnt: [*]mach_msg_type_number_t, default: *boolean_t) kern_return_t; |
| | 3918 | pub extern "c" fn thread_affinity_set(thread: thread_act_t, flavor: thread_policy_flavor_t, info: thread_policy_t, infocnt: mach_msg_type_number_t) kern_return_t; |