File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ macro_rules! acquire {
233233/// let val = Arc::clone(&val);
234234///
235235/// thread::spawn(move || {
236- /// let v = val.fetch_add(1, Ordering::SeqCst );
236+ /// let v = val.fetch_add(1, Ordering::Relaxed );
237237/// println!("{v:?}");
238238/// });
239239/// }
Original file line number Diff line number Diff line change @@ -24,10 +24,7 @@ use crate::ptr;
2424/// use std::alloc::{GlobalAlloc, Layout};
2525/// use std::cell::UnsafeCell;
2626/// use std::ptr::null_mut;
27- /// use std::sync::atomic::{
28- /// AtomicUsize,
29- /// Ordering::{Acquire, SeqCst},
30- /// };
27+ /// use std::sync::atomic::{AtomicUsize, Ordering::Relaxed};
3128///
3229/// const ARENA_SIZE: usize = 128 * 1024;
3330/// const MAX_SUPPORTED_ALIGN: usize = 4096;
@@ -61,7 +58,7 @@ use crate::ptr;
6158/// let mut allocated = 0;
6259/// if self
6360/// .remaining
64- /// .fetch_update(SeqCst, SeqCst , |mut remaining| {
61+ /// .fetch_update(Relaxed, Relaxed , |mut remaining| {
6562/// if size > remaining {
6663/// return None;
6764/// }
@@ -81,7 +78,7 @@ use crate::ptr;
8178///
8279/// fn main() {
8380/// let _s = format!("allocating a string!");
84- /// let currently = ALLOCATOR.remaining.load(Acquire );
81+ /// let currently = ALLOCATOR.remaining.load(Relaxed );
8582/// println!("allocated so far: {}", ARENA_SIZE - currently);
8683/// }
8784/// ```
You can’t perform that action at this time.
0 commit comments