Skip to content

Commit c54d5bd

Browse files
committed
Add #[inline(always)] to CriticalSection::new().
This is the only non-generic function in this crate. Rustc doesn't inline non-generic functions across crate boundaries, so without `#[inline]`, this trivial function would still end up taking space and cpu time in crates that use this, even though it does literally nothing at runtime.
1 parent a2f8b22 commit c54d5bd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ impl CriticalSection {
4848
///
4949
/// This method is meant to be used to create safe abstractions rather than
5050
/// meant to be directly used in applications.
51+
#[inline(always)]
5152
pub unsafe fn new() -> Self {
5253
CriticalSection { _0: () }
5354
}

0 commit comments

Comments
 (0)