Begin a region of patchable code. There is one requirement for the code that is emitted: It must not introduce any instructions that could be chomped (branches are an example of this). In other words, you must not call [`MachBuffer::add_cond_branch`] or [`MachBuffer::add_uncond_branch`] between calls to this method and [`MachBuffer::end_patchable`].
(&mut self)
| 614 | /// [`MachBuffer::add_uncond_branch`] between calls to this method and |
| 615 | /// [`MachBuffer::end_patchable`]. |
| 616 | pub fn start_patchable(&mut self) -> OpenPatchRegion { |
| 617 | assert!(!self.open_patchable, "Patchable regions may not be nested"); |
| 618 | self.open_patchable = true; |
| 619 | OpenPatchRegion(usize::try_from(self.cur_offset()).unwrap()) |
| 620 | } |
| 621 | |
| 622 | /// End a region of patchable code, yielding a [`PatchRegion`] value that |
| 623 | /// can be consumed later to produce a one-off mutable slice to the |
no test coverage detected