Plasma Engine  2.0
Loading...
Searching...
No Matches
plAllocator Class Referenceabstract

Base class for all memory allocators. More...

#include <Allocator.h>

Inheritance diagram for plAllocator:

Classes

struct  Stats
 

Public Member Functions

virtual void * Allocate (size_t uiSize, size_t uiAlign, plMemoryUtils::DestructorFunction destructorFunc=nullptr)=0
 Interface, do not use this directly, always use the new/delete macros below.
 
virtual void Deallocate (void *pPtr)=0
 
virtual void * Reallocate (void *pPtr, size_t uiCurrentSize, size_t uiNewSize, size_t uiAlign)
 
virtual size_t AllocatedSize (const void *pPtr)=0
 Returns the number of bytes allocated at this address.
 
virtual plAllocatorId GetId () const =0
 
virtual Stats GetStats () const =0
 

Detailed Description

Base class for all memory allocators.

Member Function Documentation

◆ Allocate()

virtual void * plAllocator::Allocate ( size_t uiSize,
size_t uiAlign,
plMemoryUtils::DestructorFunction destructorFunc = nullptr )
pure virtual

◆ AllocatedSize()

virtual size_t plAllocator::AllocatedSize ( const void * pPtr)
pure virtual

Returns the number of bytes allocated at this address.

Note
Careful! This information is only available, if allocation tracking is enabled! Otherwise 0 is returned. See plAllocatorTrackingMode and PL_ALLOC_TRACKING_DEFAULT.

Implemented in plInternal::plAllocatorImpl< AllocationPolicy, TrackingMode >, plInternal::plAllocatorImpl< plAllocPolicyHeap, TrackingMode >, plInternal::plAllocatorImpl< plAllocPolicyLinear< false >, TrackingMode >, and plInternal::plAllocatorImpl< plAllocPolicyProxy, TrackingMode >.


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