rs_new migration & link CScriptCameraWaypoint, CScriptActorKeyframe

Former-commit-id: 6f33908f35925bdf5807507701c717c5ad69e046
This commit is contained in:
2023-10-12 17:52:29 -04:00
parent fcc8b0b8e7
commit 7e364e92a5
62 changed files with 311 additions and 320 deletions

View File

@@ -9,6 +9,7 @@ namespace rstl {
struct rmemory_allocator {
rmemory_allocator() {}
rmemory_allocator(const rmemory_allocator&) {}
template < typename T >
static void allocate(T*& out, int count) {
int size = count * sizeof(T);
@@ -18,16 +19,7 @@ struct rmemory_allocator {
out = reinterpret_cast< T* >(rs_new uchar[size]);
}
}
// TODO: this fixes a regswap in vector::reserve
template < typename T >
static T* allocate2(int count) {
int size = count * sizeof(T);
if (size == 0) {
return nullptr;
} else {
return reinterpret_cast< T* >(rs_new uchar[size]);
}
}
template < typename T >
static void deallocate(T* ptr) {
if (ptr != nullptr) {