Enable instruction pushing while the window is open, disable it when closed, so the CPU hot path skips the per-instruction work otherwise.
(&mut self, enabled: bool)
| 69 | |
| 70 | /// Enable instruction pushing while the window is open, disable it when |
| 71 | /// closed, so the CPU hot path skips the per-instruction work otherwise. |
| 72 | fn set_enabled(&mut self, enabled: bool) { |
| 73 | if self.enabled == enabled { |
| 74 | return; |
| 75 | } |
| 76 | if let Ok(mut handle) = self.emu_handle.lock() |
| 77 | && handle.send(EmuCommand::SetDisasmEnabled(enabled)) |
| 78 | { |
| 79 | self.enabled = enabled; |
| 80 | } |
| 81 | } |
| 82 |