22 static void Free(
void* a_ptr);
33 #define GALLOC(a_count) RE::GMemory::Alloc((a_count))
34 #define GMEMALIGN(a_sz, a_al) RE::GMemory::Alloc((a_count), (a_al))
35 #define GREALLOC(a_ptr, a_count) RE::GMemory::Realloc((a_ptr), (a_count))
36 #define GFREE(a_ptr) RE::GMemory::Free((a_ptr))
37 #define GFREE_ALIGN(a_count) RE::GMemory::Free((a_count))
40 #define GHEAP_ALLOC(a_heap, a_count) RE::GMemory::AllocInHeap((a_heap), (a_count))
41 #define GHEAP_MEMALIGN(a_heap, a_count, a_al) RE::GMemory::AllocInHeap((a_heap), (a_count), (a_al))
42 #define GHEAP_AUTO_ALLOC(a_addr, a_count) RE::GMemory::AllocAutoHeap((a_addr), (a_count))
43 #define GHEAP_FREE(a_heap, a_ptr) RE::GMemory::FreeInHeap((a_heap), (a_ptr))
45 #define GFC_MEMORY_REDEFINE_NEW_IMPL(a_className, a_check_delete, a_statType) \
46 void* operator new(std::size_t a_count) { return GALLOC(a_count); } \
47 void* operator new[](std::size_t a_count) { return GALLOC(a_count); } \
48 void* operator new([[maybe_unused]] std::size_t a_count, void* a_plcmnt) { return a_plcmnt; } \
49 void* operator new[]([[maybe_unused]] std::size_t a_count, void* a_plcmnt) { return a_plcmnt; } \
50 void* operator new(std::size_t a_count, RE::GMemoryHeap* a_heap) { return GHEAP_ALLOC(a_heap, a_count); } \
51 void* operator new[](std::size_t a_count, RE::GMemoryHeap* a_heap) { return GHEAP_ALLOC(a_heap, a_count); } \
52 void operator delete(void* a_ptr) { GFREE(a_ptr); } \
53 void operator delete[](void* a_ptr) { GFREE(a_ptr); } \
54 void operator delete([[maybe_unused]] void* a_ptr, [[maybe_unused]] void* a_plcmnt) {} \
55 void operator delete[]([[maybe_unused]] void* a_ptr, [[maybe_unused]] void* a_plcmnt) {} \
56 void operator delete(void* a_ptr, RE::GMemoryHeap* a_heap) { GHEAP_FREE(a_heap, a_ptr); }
58 #define GFC_MEMORY_CHECK_DELETE_NONE(a_className, a_ptr)
59 #define GFC_MEMORY_REDEFINE_NEW(a_className, a_statType) GFC_MEMORY_REDEFINE_NEW_IMPL(a_className, GFC_MEMORY_CHECK_DELETE_NONE, a_statType)
Definition: GMemoryHeap.h:16
static void FreeInHeap(GMemoryHeap *a_heap, void *a_ptr)
static void DestroyArena(UPInt a_arena)
static void * Realloc(void *a_ptr, UPInt a_newCount)
static void Free(void *a_ptr)
static void * AllocInHeap(GMemoryHeap *a_heap, UPInt a_count)
static void * Alloc(UPInt a_count)
static bool DetectMemoryLeaks()
static GMemoryHeap *& GetGlobalHeapRef()
static void * AllocAutoHeap(const void *a_ptr, UPInt a_count)
static GMemoryHeap * GetGlobalHeap()
static bool ArenaIsEmpty(UPInt a_arena)
static void * AllocInHeap(GMemoryHeap *a_heap, UPInt a_count, UPInt a_al)
static void * AllocAutoHeap(const void *a_ptr, UPInt a_count, UPInt a_al)
static void * Alloc(UPInt a_count, UPInt a_al)
static GMemoryHeap * GetHeapByAddress(const void *a_ptr)
static void SetGlobalHeap(GMemoryHeap *a_heap)
static void CreateArena(UPInt a_arena, GSysAllocPaged *a_sysAlloc)
Definition: GSysAllocPaged.h:11
Definition: AbsorbEffect.h:6
std::size_t UPInt
Definition: SFTypes.h:5