Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
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, const 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(void* mem) {
22 delete mem;
23 }
24
25 void construct(T* p, const T& other) {
26 JUT_ASSERT(67, p!=NULL);
27 new(p) T(other);
28 }
29
30 void destroy(T* p) {
31 (void)p;
32 JUT_ASSERT(68, p!=NULL);
33 }
34
35 /* 0x0 */ u8 mAllocator;
36};
37}
38
39#endif /* STD_MEMORY_H */
unsigned int size
Definition __os.h:106
p
Definition e_acos.c:103
unsigned long u32
Definition types.h:12
unsigned char u8
Definition types.h:8
static const double T[]
Definition k_tan.c:106
Definition linklist.cpp:6
Definition std-memory.h:8
T * AllocateRaw(u32 size)
Definition std-memory.h:13
T * allocate(u32 count, const void *param_2)
Definition std-memory.h:9
void deallocate(T *mem, u32 size)
Definition std-memory.h:17
void DeallocateRaw(void *mem)
Definition std-memory.h:21
void destroy(T *p)
Definition std-memory.h:30
void construct(T *p, const T &other)
Definition std-memory.h:25
u8 mAllocator
Definition std-memory.h:35