UraniumCompute 0.1.0
A GPU accelerated parallel task scheduler
UN::SystemAllocator Class Reference

This allocator uses platform-specific aligned versions of malloc() and free(). More...

#include <SystemAllocator.h>

Inheritance diagram for UN::SystemAllocator:
UN::IAllocator

Public Member Functions

void * Allocate (USize size, USize alignment) override
 Allocate memory. More...
 
void Deallocate (void *pointer) override
 Deallocate memory. More...
 
const char * GetName () const override
 Get debug name of the allocator. More...
 
virtual void * Allocate (USize size, USize alignment)=0
 Allocate memory. More...
 
virtual void Deallocate (void *pointer)=0
 Deallocate memory. More...
 
virtual const char * GetName () const =0
 Get debug name of the allocator. More...
 

Static Public Member Functions

static SystemAllocatorGet ()
 Get global static instance of the system allocator.
 

Detailed Description

This allocator uses platform-specific aligned versions of malloc() and free().

Member Function Documentation

◆ Allocate()

void * UN::SystemAllocator::Allocate ( USize  size,
USize  alignment 
)
inlineoverridevirtual

Allocate memory.

Parameters
size- Size of the allocation in bytes.
alignment- Alignment of the allocation in bytes.
Returns
Pointer to the allocated block of memory.

Implements UN::IAllocator.

◆ Deallocate()

void UN::SystemAllocator::Deallocate ( void *  pointer)
inlineoverridevirtual

Deallocate memory.

Parameters
pointer- A pointer to the block of memory to deallocate.

Implements UN::IAllocator.

◆ GetName()

const char * UN::SystemAllocator::GetName ( ) const
inlineoverridevirtual

Get debug name of the allocator.

Implements UN::IAllocator.


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