summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2020-11-19 12:39:38 -0800
committerGravatar GitHub2020-11-19 12:39:38 -0800
commit6971d088939a86b3e4cf477168be8f2592679323 (patch)
tree2423f639b1713380aab4196d0abb682789416c49 /src
parentMerge pull request #4936 from lioncash/page (diff)
parentvirtual_buffer: Do nothing on resize() calls with same sizes (diff)
downloadyuzu-6971d088939a86b3e4cf477168be8f2592679323.tar.gz
yuzu-6971d088939a86b3e4cf477168be8f2592679323.tar.xz
yuzu-6971d088939a86b3e4cf477168be8f2592679323.zip
Merge pull request #4948 from lioncash/page-resize
virtual_buffer: Do nothing on resize() calls with same sizes
Diffstat (limited to '')
-rw-r--r--src/common/virtual_buffer.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/common/virtual_buffer.h b/src/common/virtual_buffer.h
index 078e61c77..91d430036 100644
--- a/src/common/virtual_buffer.h
+++ b/src/common/virtual_buffer.h
@@ -43,9 +43,14 @@ public:
43 } 43 }
44 44
45 void resize(std::size_t count) { 45 void resize(std::size_t count) {
46 const auto new_size = count * sizeof(T);
47 if (new_size == alloc_size) {
48 return;
49 }
50
46 FreeMemoryPages(base_ptr, alloc_size); 51 FreeMemoryPages(base_ptr, alloc_size);
47 52
48 alloc_size = count * sizeof(T); 53 alloc_size = new_size;
49 base_ptr = reinterpret_cast<T*>(AllocateMemoryPages(alloc_size)); 54 base_ptr = reinterpret_cast<T*>(AllocateMemoryPages(alloc_size));
50 } 55 }
51 56