(&self)
| 329 | } |
| 330 | |
| 331 | pub fn clone_neighbors(&self) -> Neighbors { |
| 332 | let _guard = self.freeze(); |
| 333 | self.neighbors |
| 334 | .iter() |
| 335 | .map(|neighbor| unsafe { |
| 336 | AtomicPtr::new( |
| 337 | neighbor |
| 338 | .load(Ordering::SeqCst) |
| 339 | .as_ref() |
| 340 | .map_or_else(ptr::null_mut, |neighbor| Box::into_raw(Box::new(*neighbor))), |
| 341 | ) |
| 342 | }) |
| 343 | .collect::<Vec<_>>() |
| 344 | .into_boxed_slice() |
| 345 | } |
| 346 | |
| 347 | pub fn get_neighbors_raw(&self) -> &Neighbors { |
| 348 | &self.neighbors |