Atomically read the opcode at `index` with Acquire ordering. Pairs with `replace_op` (Release) to ensure cache data visibility.
(&self, index: usize)
| 682 | /// Atomically read the opcode at `index` with Acquire ordering. |
| 683 | /// Pairs with `replace_op` (Release) to ensure cache data visibility. |
| 684 | pub fn read_op(&self, index: usize) -> Instruction { |
| 685 | let units = unsafe { &*self.units.get() }; |
| 686 | let ptr = units.as_ptr().wrapping_add(index) as *const AtomicU8; |
| 687 | let byte = unsafe { &*ptr }.load(Ordering::Acquire); |
| 688 | // SAFETY: Only valid Instruction values are stored via replace_op/compare_exchange_op. |
| 689 | unsafe { mem::transmute::<u8, Instruction>(byte) } |
| 690 | } |
| 691 | |
| 692 | /// Atomically read the arg byte at `index` with Relaxed ordering. |
| 693 | pub fn read_arg(&self, index: usize) -> OpArgByte { |
no test coverage detected