mirror of
https://github.com/PrimeDecomp/prime.git
synced 2025-12-12 15:26:08 +00:00
Add headers, clang-format, decompctx.py & more
Former-commit-id: 53f8d3cba7
This commit is contained in:
22
include/rstl/rmemory_allocator.hpp
Normal file
22
include/rstl/rmemory_allocator.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef _RSTL_RMEMORY_ALLOCATOR_HPP
|
||||
#define _RSTL_RMEMORY_ALLOCATOR_HPP
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "../Kyoto_CWD/CMemory.hpp"
|
||||
|
||||
namespace rstl {
|
||||
struct rmemory_allocator {
|
||||
template < typename T >
|
||||
static void allocate(T*& out, size_t count) {
|
||||
out = new T[count];
|
||||
}
|
||||
template < typename T >
|
||||
static void deallocate(T* ptr) {
|
||||
if (ptr != nullptr)
|
||||
delete ptr;
|
||||
}
|
||||
};
|
||||
} // namespace rstl
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user