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:
parent
fb778e4821
commit
7e33cdcb08
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user