Struct dynasmrt::components::LitPool
source · pub struct LitPool { /* private fields */ }
Expand description
Literal pool implementation. One can programmatically push items in this literal pool and retrieve offsets to them in the pool. Then later, the pool will be encoded into the instruction stream and items can be retrieved using the address of the literal pool. and the previously emitted offsets. Values are always at least aligned to their size.
Implementations§
source§impl LitPool
impl LitPool
sourcepub fn align(&mut self, size: usize, with: u8)
pub fn align(&mut self, size: usize, with: u8)
Add extra alignment for the next value in the literal pool
sourcepub fn push_dynamic(&mut self, id: DynamicLabel, size: RelocationSize) -> isize
pub fn push_dynamic(&mut self, id: DynamicLabel, size: RelocationSize) -> isize
Encode the relative address of a label into the literal pool (relative to the location in the pool)
sourcepub fn push_global(&mut self, name: &'static str, size: RelocationSize) -> isize
pub fn push_global(&mut self, name: &'static str, size: RelocationSize) -> isize
Encode the relative address of a label into the literal pool (relative to the location in the pool)
sourcepub fn push_forward(
&mut self,
name: &'static str,
size: RelocationSize,
) -> isize
pub fn push_forward( &mut self, name: &'static str, size: RelocationSize, ) -> isize
Encode the relative address of a label into the literal pool (relative to the location in the pool)
sourcepub fn push_backward(
&mut self,
name: &'static str,
size: RelocationSize,
) -> isize
pub fn push_backward( &mut self, name: &'static str, size: RelocationSize, ) -> isize
Encode the relative address of a label into the literal pool (relative to the location in the pool)
sourcepub fn emit<D: DynasmLabelApi>(self, assembler: &mut D)
pub fn emit<D: DynasmLabelApi>(self, assembler: &mut D)
Emit this literal pool into the specified assembler
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LitPool
impl RefUnwindSafe for LitPool
impl Send for LitPool
impl Sync for LitPool
impl Unpin for LitPool
impl UnwindSafe for LitPool
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)