Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
heapless
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Per Lindgren
heapless
Commits
f9a3dfcc
Commit
f9a3dfcc
authored
7 years ago
by
Jorge Aparicio
Browse files
Options
Downloads
Patches
Plain Diff
also test in release
parent
4a6bf95f
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
ci/script.sh
+2
-0
2 additions, 0 deletions
ci/script.sh
src/ring_buffer/mod.rs
+1
-0
1 addition, 0 deletions
src/ring_buffer/mod.rs
src/ring_buffer/spsc.rs
+1
-2
1 addition, 2 deletions
src/ring_buffer/spsc.rs
with
4 additions
and
2 deletions
ci/script.sh
+
2
−
0
View file @
f9a3dfcc
...
...
@@ -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"
...
...
This diff is collapsed.
Click to expand it.
src/ring_buffer/mod.rs
+
1
−
0
View file @
f9a3dfcc
...
...
@@ -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
>
,
}
...
...
This diff is collapsed.
Click to expand it.
src/ring_buffer/spsc.rs
+
1
−
2
View file @
f9a3dfcc
...
...
@@ -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
(())
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment