PPCAnalyst: Make CodeBuffer an alias for std::vector<CodeOp>

This class effectively acted as a "discount vector", that would simply
allocate memory and then delete it in the destructor when it goes out of
scope.

We can just use a std::vector directly to reduce this boilerplate.
This commit is contained in:
Lioncash
2018-05-18 16:14:31 -04:00
parent bb2c3bd572
commit 3a8a67025e
9 changed files with 31 additions and 58 deletions

View File

@ -155,12 +155,12 @@ void JITWidget::Update()
code_block.m_gpa = &gpa;
code_block.m_fpa = &fpa;
if (analyzer.Analyze(ppc_addr, &code_block, &code_buffer, 32000) != 0xFFFFFFFF)
if (analyzer.Analyze(ppc_addr, &code_block, &code_buffer, code_buffer.size()) != 0xFFFFFFFF)
{
std::ostringstream ppc_disasm;
for (u32 i = 0; i < code_block.m_num_instructions; i++)
{
const PPCAnalyst::CodeOp& op = code_buffer.codebuffer[i];
const PPCAnalyst::CodeOp& op = code_buffer[i];
std::string opcode = GekkoDisassembler::Disassemble(op.inst.hex, op.address);
ppc_disasm << std::setfill('0') << std::setw(8) << std::hex << op.address;
ppc_disasm << " " << opcode << std::endl;