Skip to content
Snippets Groups Projects
Commit c6c5b8fb authored by Ralf Jung's avatar Ralf Jung Committed by Carl Lerche
Browse files

Use raw pointers for potentially racy loads (#233)

Shared references assert immutability, so any concurrent access would be UB
disregarding data race concerns.
parent 7c3085aa
No related branches found
No related tags found
No related merge requests found
......@@ -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
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment