You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As #41 suggests, when dropping a large List, rust recursively calls Arc's drop function, which leads to stackoverflow. We can implement our custom Drop trait for List to prevent this, the following code seems to solve this problem:
impl<T,P>DropforList<T,P>whereP:SharedPointerKind,{fndrop(&mutself){letmut head = self.head.take();whileletSome(node) = head {ifletOk(mut node) = SharedPointer::try_unwrap(node){
head = node.next.take();}else{break;}}}}
The text was updated successfully, but these errors were encountered:
As #41 suggests, when dropping a large List, rust recursively calls Arc's drop function, which leads to stackoverflow. We can implement our custom Drop trait for List to prevent this, the following code seems to solve this problem:
The text was updated successfully, but these errors were encountered: