MCPcopy Create free account
hub / github.com/eigenform/perfect / align

Method align

perfect/src/asm.rs:435–446  ·  view source on GitHub ↗
(&mut self, alignment: usize, with: u8)

Source from the content-addressed store, hash-verified

433 }
434
435 fn align(&mut self, alignment: usize, with: u8) {
436 let misalign = self.offset().0 % alignment;
437 if (self.ops.len() + (misalign..alignment).len()) > self.len {
438 panic!("Assembled code would overflow backing allocation");
439 }
440
441 if misalign != 0 {
442 for _ in misalign..alignment {
443 self.push(with);
444 }
445 }
446 }
447}
448
449impl DynasmLabelApi for X64AssemblerFixed {

Callers

nothing calls this directly

Calls 3

offsetMethod · 0.45
lenMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected