From 7e33cdcb0854bff57ed2d5292d41092875d81363 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Mon, 21 Jan 2019 21:08:09 +0300 Subject: [PATCH] rsx: simple_array improvements - Implement move and copy ctors --- rpcs3/Emu/RSX/rsx_utils.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/rpcs3/Emu/RSX/rsx_utils.h b/rpcs3/Emu/RSX/rsx_utils.h index 40e12ccdf5..936f9918d6 100644 --- a/rpcs3/Emu/RSX/rsx_utils.h +++ b/rpcs3/Emu/RSX/rsx_utils.h @@ -716,6 +716,21 @@ namespace rsx } } + simple_array(const simple_array& other) + { + _capacity = other._capacity; + _size = other._size; + + const auto size_bytes = sizeof(Ty) * _capacity; + _data = (Ty*)malloc(size_bytes); + std::memcpy(_data, other._data, size_bytes); + } + + simple_array(simple_array&& other) noexcept + { + swap(other); + } + ~simple_array() { if (_data)