|
CACAO
|
Go to the source code of this file.
Data Structures | |
| class | MemoryAllocator< T > |
Macros | |
| #define | ALIGNSIZE 8 |
| #define | MEMORY_ALIGN(pos, size) ((((pos) + (size) - 1) / (size)) * (size)) |
| #define | PADDING(pos, size) (MEMORY_ALIGN((pos),(size)) - (pos)) |
| #define | OFFSET(s, el) ((int32_t) ((ptrint) &(((s*) 0)->el))) |
| #define | NEW(type) ((type *) mem_alloc(sizeof(type))) |
| #define | FREE(ptr, type) mem_free((ptr), sizeof(type)) |
| #define | MNEW(type, num) ((type *) mem_alloc(sizeof(type) * (num))) |
| #define | MFREE(ptr, type, num) mem_free((ptr), sizeof(type) * (num)) |
| #define | MREALLOC(ptr, type, num1, num2) |
| #define | MCOPY(dest, src, type, num) std::memcpy((dest), (src), sizeof(type) * (num)) |
| #define | MSET(ptr, byte, type, num) std::memset((ptr), (byte), sizeof(type) * (num)) |
| #define | MZERO(ptr, type, num) MSET(ptr,0,type,num) |
| #define | MMOVE(dest, src, type, num) std::memmove((dest), (src), sizeof(type) * (num)) |
| #define | GCNEW_UNCOLLECTABLE(type, num) ((type *) heap_alloc_uncollectable(sizeof(type) * (num))) |
| #define | GCNEW(type) heap_alloc(sizeof(type), true, NULL, true) |
| #define | GCMNEW(type, num) heap_alloc(sizeof(type) * (num), true, NULL, true) |
| #define | GCFREE(ptr) heap_free((ptr)) |
Enumerations | |
| enum | MemAllocPlacement { MemAlloc } |
| Allow operator new to allocate with mem_alloc. More... | |
Functions | |
| bool | memory_init (void) |
| void | memory_mprotect (void *addr, size_t len, int prot) |
| void * | memory_checked_alloc (size_t size) |
| void * | memory_cnew (int32_t size) |
| void | memory_cfree (void *p, int32_t size) |
| void * | mem_alloc (int32_t size) |
| void | mem_free (void *m, int32_t size) |
| void * | mem_realloc (void *src, int32_t len1, int32_t len2) |
| bool | memory_start_thread (void) |
| void * | operator new (size_t size, MemAllocPlacement) |
| #define ALIGNSIZE 8 |
Definition at line 36 of file memory.hpp.
| #define FREE | ( | ptr, | |
| type | |||
| ) | mem_free((ptr), sizeof(type)) |
Definition at line 94 of file memory.hpp.
| #define GCFREE | ( | ptr | ) | heap_free((ptr)) |
Definition at line 120 of file memory.hpp.
| #define GCMNEW | ( | type, | |
| num | |||
| ) | heap_alloc(sizeof(type) * (num), true, NULL, true) |
Definition at line 118 of file memory.hpp.
| #define GCNEW | ( | type | ) | heap_alloc(sizeof(type), true, NULL, true) |
Definition at line 117 of file memory.hpp.
| #define GCNEW_UNCOLLECTABLE | ( | type, | |
| num | |||
| ) | ((type *) heap_alloc_uncollectable(sizeof(type) * (num))) |
Definition at line 115 of file memory.hpp.
| #define MCOPY | ( | dest, | |
| src, | |||
| type, | |||
| num | |||
| ) | std::memcpy((dest), (src), sizeof(type) * (num)) |
Definition at line 103 of file memory.hpp.
Definition at line 37 of file memory.hpp.
| #define MFREE | ( | ptr, | |
| type, | |||
| num | |||
| ) | mem_free((ptr), sizeof(type) * (num)) |
Definition at line 97 of file memory.hpp.
| #define MMOVE | ( | dest, | |
| src, | |||
| type, | |||
| num | |||
| ) | std::memmove((dest), (src), sizeof(type) * (num)) |
Definition at line 106 of file memory.hpp.
| #define MNEW | ( | type, | |
| num | |||
| ) | ((type *) mem_alloc(sizeof(type) * (num))) |
Definition at line 96 of file memory.hpp.
| #define MREALLOC | ( | ptr, | |
| type, | |||
| num1, | |||
| num2 | |||
| ) |
Definition at line 99 of file memory.hpp.
| #define MSET | ( | ptr, | |
| byte, | |||
| type, | |||
| num | |||
| ) | std::memset((ptr), (byte), sizeof(type) * (num)) |
Definition at line 104 of file memory.hpp.
| #define MZERO | ( | ptr, | |
| type, | |||
| num | |||
| ) | MSET(ptr,0,type,num) |
Definition at line 105 of file memory.hpp.
| #define NEW | ( | type | ) | ((type *) mem_alloc(sizeof(type))) |
Definition at line 93 of file memory.hpp.
| #define OFFSET | ( | s, | |
| el | |||
| ) | ((int32_t) ((ptrint) &(((s*) 0)->el))) |
Definition at line 90 of file memory.hpp.
Definition at line 89 of file memory.hpp.
| enum MemAllocPlacement |
Allow operator new to allocate with mem_alloc.
| Enumerator | |
|---|---|
| MemAlloc | |
Definition at line 200 of file memory.hpp.
| void* mem_alloc | ( | int32_t | size | ) |
Definition at line 86 of file memory.cpp.
Definition at line 141 of file memory.cpp.
Definition at line 108 of file memory.cpp.
| void* memory_checked_alloc | ( | size_t | size | ) |
Definition at line 73 of file memory.cpp.
| void* memory_cnew | ( | int32_t | size | ) |
| bool memory_init | ( | void | ) |
Definition at line 57 of file memory.cpp.
| bool memory_start_thread | ( | void | ) |
Definition at line 217 of file memory.cpp.
|
inline |
Definition at line 202 of file memory.hpp.
1.8.5