Debugger: Optimize cpu_thread::dump_regs()

Reuse string buffer. Copies and reallocations are expensive with such large strings.
This commit is contained in:
Eladash 2022-06-22 12:00:06 +03:00 committed by Megamouse
parent 794cbd8708
commit 5e01ffdfd8
12 changed files with 35 additions and 41 deletions

View file

@ -1022,7 +1022,9 @@ void debugger_frame::WritePanels()
loc = m_regs->verticalScrollBar()->value();
hloc = m_regs->horizontalScrollBar()->value();
m_regs->clear();
m_regs->setText(qstr(cpu->dump_regs()));
m_last_reg_state.clear();
cpu->dump_regs(m_last_reg_state);
m_regs->setText(qstr(m_last_reg_state));
m_regs->verticalScrollBar()->setValue(loc);
m_regs->horizontalScrollBar()->setValue(hloc);