≈ the.bay.news

Encountered invalid memory reference while removing nodes

The Rust Programming Language Forum
Encountered invalid memory reference while removing nodes
#[derive(Debug)] struct Node<T> { data: T, next: Mutex<*mut Node<T>>, } #[derive(Debug)] pub struct List<T> { head: Mutex<*mut Node<T>>, } every node in this List is Box::into_rawed. I encountered an invalid memory reference error message while concurrently calling this function. fn remove(&self, key: &T) -> bool { let mut head = &self.head; if !self.contains(key) { return false; } while let Ok(mut guard) = head.lock() { ...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.