Nebula
Loading...
Searching...
No Matches
OSX::OSXHeap Class Reference

#include <osxheap.h>

Detailed Description

OSX implementation of Memory::Heap.

The OSX implementation uses a memory zone.

(C) 2010 Radon Labs GmbH (C) 2013-2018 Individual contributors, see AUTHORS file

Public Member Functions

 OSXHeap (const char *name, size_t initialSize=64 *1024)
 constructor (name must be a static string!)
 
 ~OSXHeap ()
 destructor
 
const char * GetName () const
 get heap name
 
void * Alloc (size_t size, size_t alignment=16)
 allocate a block of memory from the heap
 
void * Realloc (void *ptr, size_t newSize)
 re-allocate a block of memory
 
void Free (void *ptr)
 free a block of memory
 

Static Public Member Functions

static void Setup ()
 static setup method (called by Core::SysFunc::Setup)
 

Private Member Functions

 OSXHeap ()
 default constructor not allowed
 

Private Attributes

const char * name
 
malloc_zone_t * heapZone
 

Constructor & Destructor Documentation

◆ OSXHeap() [1/2]

OSX::OSXHeap::OSXHeap ( const char * name,
size_t initialSize = 64 * 1024 )

constructor (name must be a static string!)

◆ ~OSXHeap()

OSX::OSXHeap::~OSXHeap ( )

destructor

◆ OSXHeap() [2/2]

OSX::OSXHeap::OSXHeap ( )
private

default constructor not allowed

Member Function Documentation

◆ Alloc()

void * OSX::OSXHeap::Alloc ( size_t size,
size_t alignment = 16 )

allocate a block of memory from the heap

◆ Free()

void OSX::OSXHeap::Free ( void * ptr)

free a block of memory

◆ GetName()

const char * OSX::OSXHeap::GetName ( ) const
inline

get heap name

◆ Realloc()

void * OSX::OSXHeap::Realloc ( void * ptr,
size_t newSize )

re-allocate a block of memory

◆ Setup()

void OSX::OSXHeap::Setup ( )
static

static setup method (called by Core::SysFunc::Setup)

This method must be called at the beginning of the application before any threads are spawned.

Member Data Documentation

◆ heapZone

malloc_zone_t* OSX::OSXHeap::heapZone
private

◆ name

const char* OSX::OSXHeap::name
private

The documentation for this class was generated from the following files: