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

Method align_to

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

Align up to the given alignment.

(&mut self, align_to: CodeOffset)

Source from the content-addressed store, hash-verified

595
596 /// Align up to the given alignment.
597 pub fn align_to(&mut self, align_to: CodeOffset) {
598 trace!("MachBuffer: align to {}", align_to);
599 assert!(
600 align_to.is_power_of_two(),
601 "{align_to} is not a power of two"
602 );
603 while self.cur_offset() & (align_to - 1) != 0 {
604 self.put1(0);
605 }
606
607 // Post-invariant: as for `put1()`.
608 }
609
610 /// Begin a region of patchable code. There is one requirement for the
611 /// code that is emitted: It must not introduce any instructions that

Callers 4

emit_veneerMethod · 0.45
appendMethod · 0.45
emitMethod · 0.45

Calls 2

cur_offsetMethod · 0.80
put1Method · 0.45

Tested by

no test coverage detected