Unverified Commit 19a787f0 authored by ticki's avatar ticki

Fix the final fucking test in `conc`.

It didn't recurse through the destructors.
parent ccd76872
......@@ -228,6 +228,6 @@ pub fn add_garbage<T>(ptr: &'static T, dtor: fn(&'static T)) {
/// long as there are hazard protecting it.
pub fn add_garbage_box<T>(ptr: *const T) {
local::add_garbage(unsafe {
Garbage::new_box(ptr as *mut u8)
Garbage::new_box(ptr)
});
}
......@@ -148,6 +148,10 @@ impl<T> Node<T> {
// Recursively drop the next node, if it exists.
if !self.next.is_null() {
// Recurse to the next node.
(*self.next).destroy();
// Now that all of the children of the next node has been dropped, drop the node
// itself.
drop(Box::from_raw(self.next as *mut Node<T>));
}
}
......@@ -263,7 +267,7 @@ mod tests {
for _ in 0..16 {
let s = stack.clone();
j.push(thread::spawn(move || {
for _ in 0..10_000_000 {
for _ in 0..1_000_000 {
s.push(23);
assert_eq!(*s.pop().unwrap(), 23);
}
......@@ -382,7 +386,7 @@ mod tests {
drop(stack);
::gc();
assert_eq!(drops.load(atomic::Ordering::Relaxed), 200 + 16);
assert_eq!(drops.load(atomic::Ordering::Relaxed), 20 * 16 + 16);
}
#[test]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment