ML Reference
MLMemoryAllocator Class Reference

The memory allocator used by the memory manager. More...

#include <mlMemoryAllocator.h>

Static Public Member Functions

static void initialize (MLAllocationCallback allocationCallback, MLDeallocationCallback deallocationCallback)
 Initializes the memory allocator. More...
 
static void * allocate (size_t size)
 Allocates memory of the given size. Uses malloc if no allocationCallback was specified. More...
 
static void deallocate (void *data)
 Deallocates memory. Uses free if no deallocationCallback was specified. More...
 

Detailed Description

The memory allocator used by the memory manager.

Definition at line 29 of file mlMemoryAllocator.h.

Member Function Documentation

◆ allocate()

static void* MLMemoryAllocator::allocate ( size_t  size)
static

Allocates memory of the given size. Uses malloc if no allocationCallback was specified.

◆ deallocate()

static void MLMemoryAllocator::deallocate ( void *  data)
static

Deallocates memory. Uses free if no deallocationCallback was specified.

◆ initialize()

static void MLMemoryAllocator::initialize ( MLAllocationCallback  allocationCallback,
MLDeallocationCallback  deallocationCallback 
)
static

Initializes the memory allocator.

This may be called only once; this way, it is assured that only one allocator is used throughout an application.

Parameters
allocationCallbackThe callback function to allocate memory.
deallocationCallbackThe callback function to deallocate memory.

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