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.
 
static void * allocate (size_t size)
 Allocate memory of the given size. Uses malloc if no allocationCallback was specified.
 
static void deallocate (void *data)
 Deallocate memory. Uses free if no deallocationCallback was specified.
 

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

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

◆ deallocate()

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

Deallocate 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, so that 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: