Skip to content
Snippets Groups Projects
Commit f9a3dfcc authored by Jorge Aparicio's avatar Jorge Aparicio
Browse files

also test in release

parent 4a6bf95f
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,9 @@ main() {
;;
x86_64-unknown-linux-gnu)
cargo check --target $TARGET
cargo test --target $TARGET
cargo test --target $TARGET --release
export TSAN_OPTIONS="suppressions=$(pwd)/blacklist.txt"
export RUSTFLAGS="-Z sanitizer=thread"
......
......@@ -28,6 +28,7 @@ where
// this is where we enqueue new items
#[cfg(target_has_atomic = "ptr")] tail: AtomicUsize,
#[cfg(not(target_has_atomic = "ptr"))] tail: usize,
buffer: UntaggedOption<A>,
}
......
......@@ -144,8 +144,7 @@ where
// NOTE(volatile) the value of `head` can change at any time in the execution context of the
// producer so we inform this to the compiler using a volatile load
if next_tail != unsafe { ptr::read_volatile(&rb.head) } {
// NOTE(ptr::write) the memory slot that we are about to write to is uninitialized. We
// use `ptr::write` to avoid running `T`'s destructor on the uninitialized memory
// NOTE(ptr::write) see the other `enqueue` implementation above for details
unsafe { ptr::write(buffer.get_unchecked_mut(rb.tail), item) }
rb.tail = next_tail;
Ok(())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment