byteor_runtime/
platform.rs1use crate::{MlockallPreset, PinningPreset, SchedPreset};
2
3pub fn apply_mlockall_preset(preset: MlockallPreset) -> Result<(), String> {
7 byteor_ops::apply_mlockall(preset).map_err(|e| e.to_string())
8}
9
10pub fn apply_sched_preset(preset: SchedPreset) -> Result<(), String> {
12 byteor_ops::apply_sched(preset).map_err(|e| e.to_string())
13}
14
15pub fn apply_pinning_for_current_thread(
19 preset: PinningPreset,
20 role_name: &str,
21) -> Result<(), String> {
22 byteor_ops::apply_pinning_for_role(preset, role_name).map_err(|e| e.to_string())
23}
24
25pub fn pin_current_thread_to_cpu(cpu: usize) -> Result<(), String> {
27 byteor_ops::pin_current_thread_to_cpu(cpu).map_err(|e| e.to_string())
28}