Blender  V3.3
Public Member Functions | List of all members
MemoryAllocator< N > Class Template Reference

#include <MemoryAllocator.h>

Inheritance diagram for MemoryAllocator< N >:
VirtualMemoryAllocator

Public Member Functions

 MemoryAllocator ()
 
void destroy ()
 
voidallocate ()
 
void deallocate (void *obj)
 
void printInfo ()
 
int getAllocated ()
 
int getAll ()
 
int getBytes ()
 
- Public Member Functions inherited from VirtualMemoryAllocator
virtual ~VirtualMemoryAllocator ()
 

Detailed Description

template<int N>
class MemoryAllocator< N >

Dynamic memory allocator - allows allocation/deallocation

NOTE: there are 4 bytes overhead for each allocated yet unused object.

Definition at line 46 of file MemoryAllocator.h.

Constructor & Destructor Documentation

◆ MemoryAllocator()

template<int N>
MemoryAllocator< N >::MemoryAllocator ( )
inline

Constructor

Definition at line 102 of file MemoryAllocator.h.

References data, HEAP_BASE, N, and UCHAR.

Member Function Documentation

◆ allocate()

template<int N>
void* MemoryAllocator< N >::allocate ( )
inlinevirtual

Allocation method

Implements VirtualMemoryAllocator.

Definition at line 141 of file MemoryAllocator.h.

References HEAP_BASE.

◆ deallocate()

template<int N>
void MemoryAllocator< N >::deallocate ( void obj)
inlinevirtual

De-allocation method

Implements VirtualMemoryAllocator.

Definition at line 155 of file MemoryAllocator.h.

References HEAP_BASE, and UCHAR.

◆ destroy()

template<int N>
void MemoryAllocator< N >::destroy ( )
inlinevirtual

Destructor

Implements VirtualMemoryAllocator.

Definition at line 125 of file MemoryAllocator.h.

References data, and free().

◆ getAll()

template<int N>
int MemoryAllocator< N >::getAll ( )
inlinevirtual

Implements VirtualMemoryAllocator.

Definition at line 187 of file MemoryAllocator.h.

Referenced by MemoryAllocator< N >::printInfo().

◆ getAllocated()

template<int N>
int MemoryAllocator< N >::getAllocated ( )
inlinevirtual

Query methods

Implements VirtualMemoryAllocator.

Definition at line 182 of file MemoryAllocator.h.

Referenced by MemoryAllocator< N >::printInfo().

◆ getBytes()

template<int N>
int MemoryAllocator< N >::getBytes ( )
inlinevirtual

Implements VirtualMemoryAllocator.

Definition at line 192 of file MemoryAllocator.h.

References N.

Referenced by MemoryAllocator< N >::printInfo().

◆ printInfo()

template<int N>
void MemoryAllocator< N >::printInfo ( )
inlinevirtual

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