prime/include/rstl/rmemory_allocator.hpp
Luke Street 61ffa2b5ab main: Add EnsureWorldPakReady
Former-commit-id: 292dfa1eeaf98ad3901dab7cb5c89e9e0006ca77
2022-04-11 18:42:14 -04:00

23 lines
433 B
C++

#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 sz) {
out = reinterpret_cast< T* >(new u8[sz]);
}
template < typename T >
static void deallocate(T* ptr) {
if (ptr != nullptr)
delete ptr;
}
};
} // namespace rstl
#endif