30extern void*
Alloc(
HeapType heapType,
size_t size,
size_t alignment=16);
38extern bool IsOverlapping(
const unsigned char* srcPtr,
size_t srcSize,
const unsigned char* dstPtr,
size_t dstSize);
40extern void Copy(
const void* from,
void* to,
size_t numBytes);
42extern void Clear(
void* ptr,
size_t numBytes);
44extern void Fill(
void* ptr,
size_t numBytes,
unsigned char value);
51struct TotalMemoryStatus
64#if NEBULA_MEMORY_STATS
68void DisableMemoryLogging();
73#if NEBULA_MEMORY_ADVANCED_DEBUGGING
75extern bool ValidateMemory();
77extern void Checkpoint(
const char* msg);
79void DumpMemoryLeaks();
82#if NEBULA_MEMORY_ADVANCED_DEBUGGING
83#define __MEMORY_CHECKPOINT(s) Memory::Checkpoint(##s)
85#define __MEMORY_CHECKPOINT(s)
89#define __MEMORY_VALIDATE(s)
104extern void*
operator new(
size_t size);
105extern void*
operator new(
size_t size,
size_t align);
107extern void*
operator new[](
size_t size);
108extern void*
operator new[](
size_t size,
size_t align);
110extern void operator delete(
void* p);
111extern void operator delete[](
void* p);
113#define n_new(type) new type
114#define n_new_array(type,size) new type[size]
115#define n_delete(ptr) delete ptr
116#define n_delete_array(ptr) delete[] ptr
Nebula compiler specific defines and configuration.
__forceinline unsigned int align(unsigned int alignant, unsigned int alignment)
Definition scalar.h:722
Definition arenaallocator.h:31
TotalMemoryStatus GetTotalMemoryStatus()
Get the system's total memory status.
Definition osxmemory.cc:201
int volatile TotalAllocSize
Definition win32memory.cc:17
void Copy(const void *from, void *to, size_t numBytes)
Copy a chunk of memory (note the argument order is different from memcpy()!!!)
Definition osxmemory.cc:213
int volatile TotalAllocCount
Definition win32memory.cc:16
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
int volatile HeapTypeAllocCount[NumHeapTypes]
Definition win32memory.cc:18
void Fill(void *ptr, size_t numBytes, unsigned char value)
Fill memory with a specific byte.
Definition osxmemory.cc:239
int volatile HeapTypeAllocSize[NumHeapTypes]
Definition win32memory.cc:19
void Free(HeapType heapType, void *ptr)
Free a block of memory.
Definition osxmemory.cc:136
void * Realloc(HeapType heapType, void *ptr, size_t size)
Re-Allocate a block of memory from one of the global heaps.
Definition osxmemory.cc:99
bool volatile MemoryLoggingEnabled
Definition win32memory.cc:20
char * DuplicateCString(const char *from)
Duplicate a 0-terminated string, this method should no longer be used!
Definition osxmemory.cc:166
unsigned int volatile MemoryLoggingThreshold
Definition win32memory.cc:21
HeapType
Heap types are defined here.
Definition osxmemoryconfig.h:25
@ NumHeapTypes
Definition osxmemoryconfig.h:36
@ InvalidHeapType
Definition osxmemoryconfig.h:37
bool IsOverlapping(const unsigned char *srcPtr, size_t srcSize, const unsigned char *dstPtr, size_t dstSize)
Test if 2 areas of memory areas are overlapping.
Definition osxmemory.cc:180
HeapType volatile MemoryLoogingHeapType
void Clear(void *ptr, size_t numBytes)
Overwrite a chunk of memory with 0's.
Definition osxmemory.cc:229
Math::float2 size
Definition histogramcontext.cc:36
Central config file for memory setup on the OSX platform.
Get the system's total current memory, this does not only include Nebula's memory allocations but the...
Definition win32memory.h:61
unsigned int totalVirtual
Definition osxmemory.h:55
unsigned int totalPhysical
Definition osxmemory.h:53
unsigned int availVirtual
Definition osxmemory.h:56
unsigned int availPhysical
Definition osxmemory.h:54