MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / end_patchable

Method end_patchable

cranelift/codegen/src/machinst/buffer.rs:625–631  ·  view source on GitHub ↗

End a region of patchable code, yielding a [`PatchRegion`] value that can be consumed later to produce a one-off mutable slice to the associated region of the data buffer.

(&mut self, open: OpenPatchRegion)

Source from the content-addressed store, hash-verified

623 /// can be consumed later to produce a one-off mutable slice to the
624 /// associated region of the data buffer.
625 pub fn end_patchable(&mut self, open: OpenPatchRegion) -> PatchRegion {
626 // No need to assert the state of `open_patchable` here, as we take
627 // ownership of the only `OpenPatchable` value.
628 self.open_patchable = false;
629 let end = usize::try_from(self.cur_offset()).unwrap();
630 PatchRegion { range: open.0..end }
631 }
632
633 /// Allocate a `Label` to refer to some offset. May not be bound to a fixed
634 /// offset yet.

Callers 3

patch_pc_rel_offsetFunction · 0.80
newMethod · 0.80
newMethod · 0.80

Calls 2

cur_offsetMethod · 0.80
unwrapMethod · 0.45

Tested by

no test coverage detected