Loading [MathJax]/extensions/MathMenu.js
Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
std-memory.h
Go to the documentation of this file.
1#ifndef STD_MEMORY_H
2#define STD_MEMORY_H
3
5
6namespace JGadget {
7template <typename T>
8struct TAllocator {
9 T* allocate(u32 count, void *param_2) {
10 return AllocateRaw(count * sizeof(T));
11 }
12
14 return (T*)operator new(size);
15 }
16
17 void deallocate(T* mem, u32 size) {
18 DeallocateRaw(mem);
19 }
20
21 void DeallocateRaw(T* mem) {
22 delete mem;
23 }
24
25 void destroy(T* p) {
26 JUT_ASSERT(68, p!=0);
27 }
28
29 /* 0x0 */ u8 mAllocator;
30};
31}
32
33#endif /* STD_MEMORY_H */
unsigned int size
Definition __os.h:106
p
Definition e_acos.c:98
Definition binary.h:6
Definition std-memory.h:8
T * AllocateRaw(u32 size)
Definition std-memory.h:13
void deallocate(T *mem, u32 size)
Definition std-memory.h:17
T * allocate(u32 count, void *param_2)
Definition std-memory.h:9
void destroy(T *p)
Definition std-memory.h:25
void DeallocateRaw(T *mem)
Definition std-memory.h:21
u8 mAllocator
Definition std-memory.h:29
unsigned long u32
Definition types.h:9
unsigned char u8
Definition types.h:5