MCPcopy Index your code
hub / github.com/RustPython/RustPython / read_arg

Method read_arg

crates/compiler-core/src/bytecode.rs:693–698  ·  view source on GitHub ↗

Atomically read the arg byte at `index` with Relaxed ordering.

(&self, index: usize)

Source from the content-addressed store, hash-verified

691
692 /// Atomically read the arg byte at `index` with Relaxed ordering.
693 pub fn read_arg(&self, index: usize) -> OpArgByte {
694 let units = unsafe { &*self.units.get() };
695 let ptr = units.as_ptr().wrapping_add(index) as *const u8;
696 let arg_ptr = unsafe { ptr.add(1) } as *const AtomicU8;
697 OpArgByte::from(unsafe { &*arg_ptr }.load(Ordering::Relaxed))
698 }
699
700 /// Write a u16 value into a CACHE code unit at `index`.
701 /// Each CodeUnit is 2 bytes (#[repr(C)]: op u8 + arg u8), so one u16 fits exactly.

Callers 2

runMethod · 0.80
original_bytesMethod · 0.80

Calls 4

getMethod · 0.45
as_ptrMethod · 0.45
addMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected