Skip to content

Commit 2184673

Browse files
committed
avoid leaking memory in doc tests
1 parent 922b5c0 commit 2184673

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/deferred.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ use crate::{AsLink, Collector, Link};
3535
/// let mut batch = Deferred::new();
3636
///
3737
/// for item in items.iter() {
38-
/// let new = collector.link_boxed(0);
3938
/// // make the item unreachable with an atomic swap
40-
/// let old = item.swap(new, Ordering::AcqRel);
39+
/// let old = item.swap(std::ptr::null_mut(), Ordering::AcqRel);
4140
/// // don't retire just yet, add the node to the batch
4241
/// unsafe { batch.defer(old) };
4342
/// }

0 commit comments

Comments
 (0)