Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
PS::Memory::ScopedLinearAllocator Class Reference

#include <LinearAllocator.h>

Collaboration diagram for PS::Memory::ScopedLinearAllocator:

Public Member Functions

 ScopedLinearAllocator (LinearAllocator &allocator)
 
 ~ScopedLinearAllocator ()
 
void * allocate (std::size_t n, std::size_t alignment)
 
void deallocate (void *ptr, std::size_t n)
 

Private Attributes

LinearAllocator & m_Allocator
 
std::uint32_t m_AllocationCount {0u}
 

Detailed Description

See also
LinearAllocator

Scoped linear allocators ensures that the base allocator is empty.

TODO: currently it gives a very simple tree structure of one root node - base allocator and many leaves. We need to implement a tree-like call structure. It allows to reuse memory between different "tree" branches. While a "node" is locked nobody can't allocate from that allocator.

Constructor & Destructor Documentation

◆ ScopedLinearAllocator()

PS::Memory::ScopedLinearAllocator::ScopedLinearAllocator ( LinearAllocator &  allocator)
inline

◆ ~ScopedLinearAllocator()

PS::Memory::ScopedLinearAllocator::~ScopedLinearAllocator ( )
inline

Member Function Documentation

◆ allocate()

void * PS::Memory::ScopedLinearAllocator::allocate ( std::size_t  n,
std::size_t  alignment 
)
inline

◆ deallocate()

void PS::Memory::ScopedLinearAllocator::deallocate ( void *  ptr,
std::size_t  n 
)
inline

Member Data Documentation

◆ m_AllocationCount

std::uint32_t PS::Memory::ScopedLinearAllocator::m_AllocationCount {0u}
private

◆ m_Allocator

LinearAllocator& PS::Memory::ScopedLinearAllocator::m_Allocator
private

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