2#ifndef POSIX_POSIXHEAP_H
3#define POSIX_POSIXHEAP_H
36 void*
Alloc(
size_t size);
38 void*
Realloc(
void* ptr,
size_t newSize);
42 #if NEBULA_MEMORY_STATS
53 static bool ValidateAllHeaps();
55 bool ValidateHeap()
const;
57 int GetAllocCount()
const;
59 int GetAllocSize()
const;
68 #if NEBULA_MEMORY_STATS
69 int volatile allocCount;
70 int volatile allocSize;
93 #if NEBULA_MEMORY_STATS
106 #if NEBULA_MEMORY_STATS
107 size_t curSize = HeapSize(this->heap, 0, ptr);
110 return realloc(ptr, size);
120 #if NEBULA_MEMORY_STATS
121 size_t size = HeapSize(this->heap, 0, ptr);
Posix implementation of the class Memory::Heap using the Posix-Heap functions.
Definition posixheap.h:25
const char * name
Definition posixheap.h:66
const char * GetName() const
get heap name
Definition posixheap.h:81
~PosixHeap()
destructor
Definition posixheap.cc:57
PosixHeap()
default constructor not allowed
void * Alloc(size_t size)
allocate a block of memory from the heap
Definition posixheap.h:91
static void Setup()
static setup method (called by Util::Setup)
Definition posixheap.cc:25
void Free(void *ptr)
free a block of memory which has been allocated from this heap
Definition posixheap.h:117
void * Realloc(void *ptr, size_t newSize)
re-allocate a block of memory
Definition posixheap.h:104
Critical section objects are used to protect a portion of code from parallel execution.
Nebula's dynamic array class.
Definition array.h:60
the list iterator
Definition list.h:76
Implements a doubly linked list.
Definition list.h:20
#define n_assert(exp)
Definition debug.h:50
Posix implemention of a read-many write-few lock.
Definition posixsysfunc.cc:21
int Decrement(int volatile *var)
interlocked decrement, return result
Definition gccinterlocked.cc:157
int Add(int volatile *var, int add)
interlocked add
Definition gccinterlocked.cc:22
int Increment(int volatile *var)
interlocked increment, return result
Definition gccinterlocked.cc:148