use core::convert::{From, TryFrom};
use core::fmt;
use core::hash::{Hash, Hasher};
+use core::hint;
use core::intrinsics::abort;
use core::iter;
use core::marker::{PhantomData, Unpin, Unsize};
loop {
// check if the weak counter is currently "locked"; if so, spin.
if cur == usize::MAX {
+ hint::spin_loop();
cur = this.inner().weak.load(Relaxed);
continue;
}
fn from_box(v: Box<T>) -> Arc<T> {
unsafe {
- let box_unique = Box::into_unique(v);
+ let (box_unique, alloc) = Box::into_unique(v);
let bptr = box_unique.as_ptr();
let value_size = size_of_val(&*bptr);
);
// Free the allocation without dropping its contents
- box_free(box_unique);
+ box_free(box_unique, alloc);
Self::from_ptr(ptr)
}