diff --git a/sub/core/src/pod.rs b/sub/core/src/pod.rs index 991f4a7..566013b 100644 --- a/sub/core/src/pod.rs +++ b/sub/core/src/pod.rs @@ -31,17 +31,19 @@ unsafe impl Sync for Mut {} unsafe impl Send for Mut {} impl Mut { + #[inline(always)]#[inline(always)] pub const fn new(value: T) -> Self { Self(core::cell::UnsafeCell::new(value)) } + #[inline(always)] pub const fn as_ptr(&self) -> *mut T { self.0.get() } } impl Mut { - pub fn set(&self, value: T) { unsafe { core::ptr::write(self.as_ptr(), value) } } - pub fn get(&self) -> T { unsafe { core::ptr::read(self.as_ptr()) } } + #[inline(always)] pub fn set(&self, value: T) { unsafe { core::ptr::write(self.as_ptr(), value) } } + #[inline(always)] pub fn get(&self) -> T { unsafe { core::ptr::read(self.as_ptr()) } } } impl Mut> { pub const fn zeroed() -> Self { Self(core::cell::UnsafeCell::new(MaybeUninit::zeroed())) } @@ -50,5 +52,8 @@ impl Mut> { impl Deref for Mut { type Target = core::cell::UnsafeCell; - fn deref(&self) -> &Self::Target { &self.0 } + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } } \ No newline at end of file