From 75ab62f9d22901862aafcb3ead9b6a7158fad410 Mon Sep 17 00:00:00 2001 From: "Cliff L. Biffle" Date: Fri, 13 Dec 2024 10:22:41 -0800 Subject: [PATCH] kerncore: add must_use and inline(always) The missing must_use was just an oversight -- access check functions that return flags, instead of faulting or returning Result, should always be must_use. inline(always) turns out to significantly improve performance of Task::can_access by specializing the generated code for the predicate it uses. --- sys/kerncore/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kerncore/src/lib.rs b/sys/kerncore/src/lib.rs index f7657b22e..1fddd5d1b 100644 --- a/sys/kerncore/src/lib.rs +++ b/sys/kerncore/src/lib.rs @@ -152,6 +152,8 @@ impl MemoryRegion for &T { /// that meet the `region_ok` condition. /// /// `false` otherwise. +#[must_use] +#[inline(always)] pub fn can_access( slice: S, table: &[R],