prime/include/rstl/rmemory_allocator.hpp
Luke Street adb54a9892 Symbol fixes, headers & main progress
Former-commit-id: 6944a14e890aff84111901c37e9a7b96a3e38517
2022-10-01 02:19:15 -04:00

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