vsg: vsg::Allocator Class Reference

vsg 1.1.9 VulkanSceneGraph library |

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | List of all members
vsg::Allocator Class Referenceabstract

`#include <Allocator.h>`

Inheritance diagram for vsg::Allocator:
[legend]

## Public Member Functions
| Allocator (size_t in_defaultAlignment=4)
| Allocator (std::unique_ptr< Allocator > in_nestedAllocator, size_t in_defaultAlignment=4)
virtual void * | allocate (std::size_t size, AllocatorAffinity allocatorAffinity=ALLOCATOR_AFFINITY_OBJECTS)=0
| allocate from the pool of memory blocks, or allocate from a new memory block
virtual bool | deallocate (void *ptr, std::size_t size)=0
| deallocate, returning data to pool.
virtual size_t | deleteEmptyMemoryBlocks ()=0
| delete any MemoryBlock that are empty
virtual size_t | totalAvailableSize () const =0
| return the total available size of allocated MemoryBlocks
virtual size_t | totalReservedSize () const =0
| return the total reserved size of allocated MemoryBlocks
virtual size_t | totalMemorySize () const =0
| return the total memory size of allocated MemoryBlocks
virtual void | setBlockSize (AllocatorAffinity allocatorAffinity, size_t blockSize)=0
virtual void | report (std::ostream &out) const =0
| report stats about blocks of memory allocated.

## Static Public Member Functions
static std::unique_ptr< Allocator > & | instance ()
| Allocator singleton.

## Public Attributes
AllocatorType | allocatorType = ALLOCATOR_TYPE_VSG_ALLOCATOR
std::mutex | mutex
size_t | defaultAlignment = 4

## Protected Attributes
std::unique_ptr< Allocator > | nestedAllocator

## Detailed Description

extensible Allocator that handles allocation and deallocation of scene graph CPU memory,

## Member Function Documentation

## ◆ allocate()

virtual void * vsg::Allocator::allocate | ( | std::size_t | size,
|  | AllocatorAffinity | allocatorAffinity = ALLOCATOR_AFFINITY_OBJECTS )
| pure virtual

allocate from the pool of memory blocks, or allocate from a new memory block

Implemented in vsg::IntrusiveAllocator.

## ◆ deallocate()

virtual bool vsg::Allocator::deallocate | ( | void * | ptr,
|  | std::size_t | size )
| pure virtual

deallocate, returning data to pool.

Implemented in vsg::IntrusiveAllocator.

## ◆ deleteEmptyMemoryBlocks()

virtual size_t vsg::Allocator::deleteEmptyMemoryBlocks | ( |  | ) |
| pure virtual

delete any MemoryBlock that are empty

Implemented in vsg::IntrusiveAllocator.

## ◆ report()

virtual void vsg::Allocator::report | ( | std::ostream & | out | ) | const
| pure virtual

report stats about blocks of memory allocated.

Implemented in vsg::IntrusiveAllocator.

## ◆ totalAvailableSize()

virtual size_t vsg::Allocator::totalAvailableSize | ( |  | ) | const
| pure virtual

return the total available size of allocated MemoryBlocks

Implemented in vsg::IntrusiveAllocator.

## ◆ totalMemorySize()

virtual size_t vsg::Allocator::totalMemorySize | ( |  | ) | const
| pure virtual

return the total memory size of allocated MemoryBlocks

Implemented in vsg::IntrusiveAllocator.

## ◆ totalReservedSize()

virtual size_t vsg::Allocator::totalReservedSize | ( |  | ) | const
| pure virtual

return the total reserved size of allocated MemoryBlocks

Implemented in vsg::IntrusiveAllocator.

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

- include/vsg/core/Allocator.h