Nebula
|
Lowlevel memory functions for the OSX platform.
(C) 2010 Radon Labs GmbH (C) 2013-2018 Individual contributors, see AUTHORS file
Go to the source code of this file.
Classes | |
struct | Memory::TotalMemoryStatus |
Get the system's total current memory, this does not only include Nebula's memory allocations but the memory usage of the entire system. More... | |
Namespaces | |
namespace | Memory |
Allocates memory using the TLSF method (http://www.gii.upv.es/tlsf/files/ecrts04_tlsf.pdf), with extended handling of padding to better suit GPUs. | |
Macros | |
#define | __MEMORY_CHECKPOINT(s) |
Debug and memory validation functions. | |
#define | __MEMORY_VALIDATE(s) |
#define | n_new(type) |
#define | n_new_array(type, size) |
#define | n_delete(ptr) |
#define | n_delete_array(ptr) |
Functions | |
void * | Memory::Alloc (HeapType heapType, size_t size, size_t alignment) |
Allocate a block of memory from one of the global heaps. | |
void * | Memory::Realloc (HeapType heapType, void *ptr, size_t size) |
Re-Allocate a block of memory from one of the global heaps. | |
void | Memory::Free (HeapType heapType, void *ptr) |
Free a block of memory. | |
char * | Memory::DuplicateCString (const char *from) |
Duplicate a 0-terminated string, this method should no longer be used! | |
bool | Memory::IsOverlapping (const unsigned char *srcPtr, size_t srcSize, const unsigned char *dstPtr, size_t dstSize) |
Test if 2 areas of memory areas are overlapping. | |
void | Memory::Copy (const void *from, void *to, size_t numBytes) |
Copy a chunk of memory (note the argument order is different from memcpy()!!!) | |
void | Memory::Clear (void *ptr, size_t numBytes) |
Overwrite a chunk of memory with 0's. | |
void | Memory::Fill (void *ptr, size_t numBytes, unsigned char value) |
Fill memory with a specific byte. | |
TotalMemoryStatus | Memory::GetTotalMemoryStatus () |
Get the system's total memory status. | |
void * | operator new (size_t size) |
Replacement global new/delete operators. | |
void * | operator new (size_t size, size_t align) |
void * | operator new[] (size_t size) |
Replacement global new[] operators. | |
void * | operator new[] (size_t size, size_t align) |
void | operator delete (void *p) |
Replacement global delete operator. | |
void | operator delete[] (void *p) |
Replacement global delete[] operator. | |
Variables | |
int volatile | Memory::TotalAllocCount = 0 |
int volatile | Memory::TotalAllocSize = 0 |
int volatile | Memory::HeapTypeAllocCount [NumHeapTypes] = { 0 } |
int volatile | Memory::HeapTypeAllocSize [NumHeapTypes] = { 0 } |
bool volatile | Memory::MemoryLoggingEnabled = false |
unsigned int volatile | Memory::MemoryLoggingThreshold = 0 |
HeapType volatile | Memory::MemoryLoogingHeapType |
#define __MEMORY_CHECKPOINT | ( | s | ) |
Debug and memory validation functions.
#define __MEMORY_VALIDATE | ( | s | ) |
#define n_delete | ( | ptr | ) |
#define n_delete_array | ( | ptr | ) |
#define n_new | ( | type | ) |
#define n_new_array | ( | type, | |
size ) |
|
externnoexcept |
Replacement global delete operator.
|
externnoexcept |
Replacement global delete[] operator.
|
extern |
Replacement global new/delete operators.
Replacement global new/delete operators.
|
extern |
|
extern |
Replacement global new[] operators.
|
extern |