forked from rosebudai/OpenRCT2-Web
Remove Memory::Duplicate and Memory::DuplicateArray (#7142)
This commit is contained in:
1 parent
04ea015302
commit
142facb8a3
9 files changed
+44
-79
No files matched your search
@@ -15,6 +15,7 @@
|
||||
#pragma endregion
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include "Math.hpp"
|
||||
#include "Memory.hpp"
|
||||
#include "MemoryStream.h"
|
||||
@@ -27,7 +28,8 @@ MemoryStream::MemoryStream(const MemoryStream ©)
|
||||
|
||||
if (_access & MEMORY_ACCESS::OWNER)
|
||||
{
|
||||
_data = Memory::Duplicate(copy._data, _dataCapacity);
|
||||
_data = Memory::Allocate<void>(_dataCapacity);
|
||||
std::memcpy(_data, copy._data, _dataCapacity);
|
||||
_position = (void*)((uintptr_t)_data + copy.GetPosition());
|
||||
}
|
||||
}
|
||||
@@ -71,7 +73,9 @@ const void * MemoryStream::GetData() const
|
||||
|
||||
void * MemoryStream::GetDataCopy() const
|
||||
{
|
||||
return Memory::Duplicate(_data, _dataSize);
|
||||
auto result = Memory::Allocate<void>(_dataSize);
|
||||
std::memcpy(result, _data, _dataSize);
|
||||
return result;
|
||||
}
|
||||
|
||||
void * MemoryStream::TakeData()
|
||||
|
||||
Reference in new issue
Block a user