Files
tp/include/JSystem/JGadget/std-memory.h
T
LagoLunatic 9eea9289b1 Fix JUT_ASSERT and several other macros (#2711)
* Fix JUT_ASSERT to be a nested define

* Switch names that appear in asserts to be constants instead of defines

* Replace `0` in asserts with `NULL` or `FALSE`

* Fix fpclassify

* Fix ARRAY_SIZE

* Use G_CM3D_F_INF

* More fixes for fpclassify

* Remove FLOAT_LABEL

* Remove incorrect FLAG_ON macro

* Remove UNK_BSS macro

* Silence clangd unused header warning for PCH
2025-09-28 13:11:07 -07:00

34 lines
582 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!=NULL);
}
/* 0x0 */ u8 mAllocator;
};
}
#endif /* STD_MEMORY_H */