1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-23 03:02:53 +01:00

rsx: simple_array<T> improvements

- Implement move and copy ctors
This commit is contained in:
kd-11 2019-01-21 21:08:09 +03:00 committed by kd-11
parent fb778e4821
commit 7e33cdcb08

View File

@ -716,6 +716,21 @@ namespace rsx
}
}
simple_array(const simple_array<Ty>& 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<Ty>&& other) noexcept
{
swap(other);
}
~simple_array()
{
if (_data)