mirror of
https://github.com/zeldaret/tp
synced 2026-05-23 23:05:36 -04:00
24b72a5302
* cleanup f_pc files * cleanup f_op files * fix a couple f_op_actor_mng functions * minor JSystem work
34 lines
579 B
C++
34 lines
579 B
C++
#ifndef STD_MEMORY_H
|
|
#define STD_MEMORY_H
|
|
|
|
#include "JSystem/JUtility/JUTAssert.h"
|
|
|
|
namespace JGadget {
|
|
template <typename T>
|
|
struct TAllocator {
|
|
T* allocate(u32 count, void *param_2) {
|
|
return AllocateRaw(count * sizeof(T));
|
|
}
|
|
|
|
T* AllocateRaw(u32 size) {
|
|
return (T*)operator new(size);
|
|
}
|
|
|
|
void deallocate(T* mem, u32 size) {
|
|
DeallocateRaw(mem);
|
|
}
|
|
|
|
void DeallocateRaw(T* mem) {
|
|
delete mem;
|
|
}
|
|
|
|
void destroy(T* p) {
|
|
JUT_ASSERT(68, p!=0);
|
|
}
|
|
|
|
/* 0x0 */ u8 mAllocator;
|
|
};
|
|
}
|
|
|
|
#endif /* STD_MEMORY_H */
|