Cogs.Core
Public Member Functions | Private Attributes | List of all members
Cogs::Core::TextureAllocator Class Reference
Inheritance diagram for Cogs::Core::TextureAllocator:
Cogs::Memory::Allocator

Public Member Functions

void * allocate (size_t size, size_t alignment=0, MemBlockType type=MemBlockType::Block) override
 Allocate raw memory.
 
void deallocate (void *ptr, size_t size, MemBlockType type=MemBlockType::Block) override
 Deallocate the memory block at the given pointer, with the given size.
 
- Public Member Functions inherited from Cogs::Memory::Allocator
virtual void * allocate (size_t size, size_t alignment=0, MemBlockType type=MemBlockType::Block)
 Allocate raw memory.
 
virtual void deallocate (void *ptr, size_t size, MemBlockType type=MemBlockType::Block)
 Deallocate the memory block at the given pointer, with the given size.
 
virtual void changeType (void *ptr, size_t size, MemBlockType oldType, MemBlockType newType)
 
virtual size_t getAllocatedBytes () const
 Return the number of bytes currently allocated by this allocator.
 
virtual size_t getAllocationCount () const
 Return the number of allocations currently allocated by this allocator.
 

Private Attributes

Atomic< size_t > allocationSize { 0 }
 

Additional Inherited Members

- Static Public Member Functions inherited from Cogs::Memory::Allocator
static AllocatordefaultAllocator ()
 Gets the system default allocator.
 
static AllocatoroverflowAllocator ()
 
- Protected Attributes inherited from Cogs::Memory::Allocator
Cogs::Atomic< size_t > allocated {0}
 
Cogs::Atomic< size_t > allocations {0}
 

Detailed Description

Definition at line 17 of file Texture.cpp.

Constructor & Destructor Documentation

◆ ~TextureAllocator()

Cogs::Core::TextureAllocator::~TextureAllocator ( )
inline

Definition at line 20 of file Texture.cpp.

Member Function Documentation

◆ allocate()

void * Cogs::Core::TextureAllocator::allocate ( size_t  size,
size_t  alignment = 0,
MemBlockType  type = MemBlockType::Block 
)
inlineoverridevirtual

Allocate raw memory.

Parameters
sizeSize in bytes of requested allocation.
alignmentAlignment in bytes.
Returns
Pointer to allocated memory.

Reimplemented from Cogs::Memory::Allocator.

Definition at line 27 of file Texture.cpp.

References Cogs::Memory::Allocator::allocate().

◆ deallocate()

void Cogs::Core::TextureAllocator::deallocate ( void *  ptr,
size_t  size,
MemBlockType  type = MemBlockType::Block 
)
inlineoverridevirtual

Deallocate the memory block at the given pointer, with the given size.

The size parameter may be given to enable extra checking when releasing memory.

Parameters
ptrPointer to previously allocated memory.
sizeSize in bytes of the given allocation.

Reimplemented from Cogs::Memory::Allocator.

Definition at line 34 of file Texture.cpp.

References Cogs::Memory::Allocator::deallocate().

Member Data Documentation

◆ allocationSize

Atomic<size_t> Cogs::Core::TextureAllocator::allocationSize { 0 }
private

Definition at line 42 of file Texture.cpp.


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