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 {
233
233
/// let val = Arc::clone(&val);
234
234
///
235
235
/// thread::spawn(move || {
236
- /// let v = val.fetch_add(1, Ordering::SeqCst );
236
+ /// let v = val.fetch_add(1, Ordering::Relaxed );
237
237
/// println!("{v:?}");
238
238
/// });
239
239
/// }
Original file line number Diff line number Diff line change @@ -24,10 +24,7 @@ use crate::ptr;
24
24
/// use std::alloc::{GlobalAlloc, Layout};
25
25
/// use std::cell::UnsafeCell;
26
26
/// 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};
31
28
///
32
29
/// const ARENA_SIZE: usize = 128 * 1024;
33
30
/// const MAX_SUPPORTED_ALIGN: usize = 4096;
@@ -61,7 +58,7 @@ use crate::ptr;
61
58
/// let mut allocated = 0;
62
59
/// if self
63
60
/// .remaining
64
- /// .fetch_update(SeqCst, SeqCst , |mut remaining| {
61
+ /// .fetch_update(Relaxed, Relaxed , |mut remaining| {
65
62
/// if size > remaining {
66
63
/// return None;
67
64
/// }
@@ -81,7 +78,7 @@ use crate::ptr;
81
78
///
82
79
/// fn main() {
83
80
/// let _s = format!("allocating a string!");
84
- /// let currently = ALLOCATOR.remaining.load(Acquire );
81
+ /// let currently = ALLOCATOR.remaining.load(Relaxed );
85
82
/// println!("allocated so far: {}", ARENA_SIZE - currently);
86
83
/// }
87
84
/// ```
You can’t perform that action at this time.
0 commit comments