mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-18 22:05:37 +01:00
Fixed aliasing issue due to RacyCell implementation
This commit is contained in:
parent
b25d775771
commit
8065d741ac
10 changed files with 47 additions and 49 deletions
12
src/lib.rs
12
src/lib.rs
|
|
@ -69,16 +69,16 @@ impl<T> RacyCell<T> {
|
|||
RacyCell(UnsafeCell::new(value))
|
||||
}
|
||||
|
||||
/// Get `&mut T`
|
||||
/// Get `*mut T`
|
||||
#[inline(always)]
|
||||
pub unsafe fn get_mut_unchecked(&self) -> &mut T {
|
||||
&mut *self.0.get()
|
||||
pub unsafe fn get_mut(&self) -> *mut T {
|
||||
self.0.get()
|
||||
}
|
||||
|
||||
/// Get `&T`
|
||||
/// Get `*const T`
|
||||
#[inline(always)]
|
||||
pub unsafe fn get_unchecked(&self) -> &T {
|
||||
&*self.0.get()
|
||||
pub unsafe fn get(&self) -> *const T {
|
||||
self.0.get()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue