Align up to the given alignment.
(&mut self, align_to: CodeOffset)
| 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 |
no test coverage detected