prime/include/rstl/rmemory_allocator.hpp
Luke Street 27d94af97b Add headers, clang-format, decompctx.py & more
Former-commit-id: 53f8d3cba7bd2d675cf6b99544af58bd24f98620
2022-04-09 20:17:13 -04:00

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