LV2: Memory state post-exitspawn fixes

* Fix memory capacity if SDK version of the following executable differs from the original process'.
* Keep user memory containers, they are not freed at exitspawn!

Hw test 4bf60023ee
This commit is contained in:
Eladash 2022-05-12 19:59:33 +03:00 committed by Ivan
parent a2a6303a22
commit 524da5dc54
4 changed files with 52 additions and 12 deletions

View file

@ -1840,7 +1840,17 @@ bool ppu_load_exec(const ppu_exec_object& elf)
mem_size += 0xC000000;
}
g_fxo->init<lv2_memory_container>(mem_size)->used += primary_stacksize;
if (Emu.init_mem_containers)
{
// Refer to sys_process_exit2 for explanation
Emu.init_mem_containers(mem_size);
}
else
{
g_fxo->init<lv2_memory_container>(mem_size);
}
g_fxo->get<lv2_memory_container>().used += primary_stacksize;
ppu->cmd_push({ppu_cmd::initialize, 0});