mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-10-19 13:38:05 +00:00
scratch_buffer: Explicitly defing resize and resize_destructive functions
resize keeps previous data intact when the buffer grows resize_destructive destroys the previous data when the buffer grows
This commit is contained in:
parent
37ac7d7841
commit
4d5adfb3c9
7 changed files with 108 additions and 19 deletions
|
@ -1926,7 +1926,7 @@ std::span<const u8> BufferCache<P>::ImmediateBufferWithData(VAddr cpu_addr, size
|
|||
|
||||
template <class P>
|
||||
std::span<u8> BufferCache<P>::ImmediateBuffer(size_t wanted_capacity) {
|
||||
immediate_buffer_alloc.resize(wanted_capacity);
|
||||
immediate_buffer_alloc.resize_destructive(wanted_capacity);
|
||||
return std::span<u8>(immediate_buffer_alloc.data(), wanted_capacity);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue