prime/include/rstl/rmemory_allocator.hpp
Luke Street bed1bb88de Reorganize includes to match asm
Former-commit-id: 848752477e6833629bb0ce30125ca6f5dbffccd1
2022-07-18 18:42:58 -04:00

23 lines
432 B
C++

#ifndef _RSTL_RMEMORY_ALLOCATOR_HPP
#define _RSTL_RMEMORY_ALLOCATOR_HPP
#include "types.h"
#include "Kyoto/Alloc/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