(&self)
| 546 | |
| 547 | impl Clone for CodeUnits { |
| 548 | fn clone(&self) -> Self { |
| 549 | // SAFETY: No concurrent mutation during clone — cloning is only done |
| 550 | // during code object construction or marshaling, not while instrumented. |
| 551 | let units = unsafe { &*self.units.get() }.clone(); |
| 552 | let adaptive_counters = self |
| 553 | .adaptive_counters |
| 554 | .iter() |
| 555 | .map(|c| AtomicU16::new(c.load(Ordering::Relaxed))) |
| 556 | .collect(); |
| 557 | let pointer_cache = self |
| 558 | .pointer_cache |
| 559 | .iter() |
| 560 | .map(|c| AtomicUsize::new(c.load(Ordering::Relaxed))) |
| 561 | .collect(); |
| 562 | Self { |
| 563 | units: UnsafeCell::new(units), |
| 564 | adaptive_counters, |
| 565 | pointer_cache, |
| 566 | } |
| 567 | } |
| 568 | } |
| 569 | |
| 570 | impl fmt::Debug for CodeUnits { |
no test coverage detected