Use raw pointers for potentially racy loads (#233)

Shared references assert immutability, so any concurrent access would be UB
disregarding data race concerns.
This commit is contained in:
Ralf Jung
2018-11-17 16:51:50 +01:00
committed by Carl Lerche
parent fe8b9606c4
commit 87c9f5cb96
+2 -2
View File
@@ -2438,7 +2438,7 @@ impl Inner {
#[inline]
fn imp(arc: &AtomicPtr<Shared>) -> usize {
unsafe {
let p: &u8 = mem::transmute(arc);
let p: *const u8 = mem::transmute(arc);
(*p as usize) & KIND_MASK
}
}
@@ -2447,7 +2447,7 @@ impl Inner {
#[inline]
fn imp(arc: &AtomicPtr<Shared>) -> usize {
unsafe {
let p: &usize = mem::transmute(arc);
let p: *const usize = mem::transmute(arc);
*p & KIND_MASK
}
}