mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-12-11 19:03:58 +00:00
Refactor new usage to rs_new
Former-commit-id: cbf7b415ed96fe9ad0a0a9a11cc1ffb18b5c07da
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define _RSTL_RC_PTR
|
||||
|
||||
#include "types.h"
|
||||
#include "rstl/rmemory_allocator.hpp"
|
||||
|
||||
namespace rstl {
|
||||
class CRefData {
|
||||
@@ -25,7 +26,7 @@ template < typename T >
|
||||
class rc_ptr {
|
||||
public:
|
||||
rc_ptr() : x0_refData(&CRefData::sNull) { x0_refData->AddRef(); }
|
||||
rc_ptr(const T* ptr) : x0_refData(new CRefData(ptr)) {}
|
||||
rc_ptr(const T* ptr) : x0_refData(rs_new CRefData(ptr)) {}
|
||||
rc_ptr(const rc_ptr& other) : x0_refData(other.x0_refData) { x0_refData->AddRef(); }
|
||||
~rc_ptr() { ReleaseData(); }
|
||||
T* GetPtr() const { return static_cast< T* >(x0_refData->GetPtr()); }
|
||||
|
||||
@@ -15,7 +15,7 @@ struct rmemory_allocator {
|
||||
if (size == 0) {
|
||||
out = nullptr;
|
||||
} else {
|
||||
out = reinterpret_cast< T* >(NEW uchar[size]);
|
||||
out = reinterpret_cast< T* >(rs_new uchar[size]);
|
||||
}
|
||||
}
|
||||
// TODO: this fixes a regswap in vector::reserve
|
||||
@@ -25,7 +25,7 @@ struct rmemory_allocator {
|
||||
if (size == 0) {
|
||||
return nullptr;
|
||||
} else {
|
||||
return reinterpret_cast< T* >(NEW uchar[size]);
|
||||
return reinterpret_cast< T* >(rs_new uchar[size]);
|
||||
}
|
||||
}
|
||||
template < typename T >
|
||||
|
||||
Reference in New Issue
Block a user