mirror of
https://github.com/yuzu-emu/yuzu-mainline
synced 2024-11-22 22:43:36 +00:00
Reserve enough space in the vector that holds the linear heap memory to prevent relocations of the backing memory when growing too much. Closes #1790
This commit is contained in:
parent
18b517e236
commit
64da2bf0cd
1 changed files with 3 additions and 0 deletions
|
@ -55,6 +55,9 @@ void MemoryInit(u32 mem_type) {
|
|||
memory_regions[i].size = memory_region_sizes[mem_type][i];
|
||||
memory_regions[i].used = 0;
|
||||
memory_regions[i].linear_heap_memory = std::make_shared<std::vector<u8>>();
|
||||
// Reserve enough space for this region of FCRAM.
|
||||
// We do not want this block of memory to be relocated when allocating from it.
|
||||
memory_regions[i].linear_heap_memory->reserve(memory_regions[i].size);
|
||||
|
||||
base += memory_regions[i].size;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue