18operator"" _KB(
const unsigned long long val)
27operator"" _MB(
const unsigned long long val)
29 return val * 1024 * 1024;
36operator"" _GB(
const unsigned long long val)
38 return val * 1024 * 1024 * 1024;
43#elif ( __OSX__ || __APPLE__ || __linux__ )
46#error "UNKNOWN PLATFORM"
66template<
typename TYPE>
71 if constexpr (!std::is_trivially_constructible<TYPE>::value)
73 for (
size_t i = 0; i < size; ++i)
75 ::new( &buffer[i] ) TYPE;
84template<
typename TYPE>
97 n_error(
"ArrayAllocStack is out of bounds!");
101 if constexpr (!std::is_trivially_constructible<TYPE>::value)
103 for (
size_t i = 0; i < size; ++i)
105 ::new(&buffer[i]) TYPE;
114template<
typename TYPE>
118 if constexpr (!std::is_trivially_destructible<TYPE>::value)
120 for (
size_t i = 0; i < size; ++i)
131template<
typename TYPE>
137 if constexpr (!std::is_trivially_destructible<TYPE>::value)
139 for (
size_t i = 0; i < size; ++i)
void __cdecl n_error(const char *msg,...)
This function is called when a serious situation is encountered which requires abortion of the applic...
Definition debug.cc:138
#define n_assert(exp)
Definition debug.h:50
Nebula compiler specific defines and configuration.
thread_local ThreadLocalMiniHeap N_ThreadLocalMiniHeap
Definition memory.cc:6
void ArrayFreeStack(size_t size, TYPE *buffer)
Definition memory.h:133
TYPE * ArrayAllocStack(size_t size)
Definition memory.h:86
void ArrayFree(size_t size, TYPE *buffer)
Definition memory.h:116
TYPE * ArrayAlloc(size_t size)
Definition memory.h:68
void * Alloc(HeapType heapType, size_t size, size_t alignment)
Allocate a block of memory from one of the global heaps.
Definition osxmemory.cc:56
void Free(HeapType heapType, void *ptr)
Free a block of memory.
Definition osxmemory.cc:136
@ ObjectArrayHeap
Definition osxmemoryconfig.h:28
Memory subsystem features for the Posix platform.
void Realloc(size_t numBytes)
Definition memory.cc:34
char * heap
Definition memory.h:56
~ThreadLocalMiniHeap()
Definition memory.cc:22
size_t capacity
Definition memory.h:58
ThreadLocalMiniHeap()
Definition memory.cc:11
size_t iterator
Definition memory.h:57
Memory subsystem features for win32.