Hubris Engine Dev
A Project to learn and get into Game Engine developement.
 
Loading...
Searching...
No Matches
Hubris::Memory Class Reference

#include <Memory.h>

Static Public Member Functions

static Block Alloc (size_t bufSize)
 Allocates a thread-local block.
 
static Block Resize (Block &block, size_t newSize)
 Attempts to resize a block, this can move the block to a diffrent location.
 
static void Free (Block &buffer)
 Frees a buffer.
 
static void ExpandInternalArena (size_t width)
 Internal use. Arenas are not expandable except the internal arena.
 
static ArenaCreateArena (size_t size)
 Creates a thread-local arena.
 
static SharedBlock AllocShared (size_t size)
 Allocates a block with syncing constructs.
 
static ArenaCreateGlobalArena (size_t width)
 Allocates a shared arena for multi-threaded use.
 
static void FreeArena (Arena)
 Attempts to free an areana, if the arean has any blocks in use this call with throw.
 
static bool IsValid (const void *pointer)
 
static bool IsEngineAllocated (const void *pointer)
 
static bool IsFree (const Block &block) noexcept
 
static bool IsThreadLocal (const Block &block) noexcept
 
static bool IsShared (const void *blockptr) noexcept
 
static size_t MemoryUsed (const Arena &arena)
 
static size_t GetMemoryAvailable (const Arena &arena)
 
static unsigned int TotalAllocationCount () noexcept
 
static unsigned int TotalDeallocationCount () noexcept
 
static unsigned int TotalBlockResizeCount () noexcept
 
static unsigned int TotalArenasAllocated () noexcept
 
static unsigned int TotalArenasFreed () noexcept
 
static unsigned int ThreadAllocationCount () noexcept
 
static unsigned int ThreadDeallocationCount () noexcept
 
static unsigned int ThreadBlockResizeCount () noexcept
 
static unsigned int ThreadArenasAllocated () noexcept
 
static unsigned int ThreadArenasFreed () noexcept
 
static size_t TotalMemoryAllocated () noexcept
 
static size_t TotalMemoryFreed () noexcept
 
static size_t ThreadMemoryUsed () noexcept
 
static size_t ThreadMemoryFreed () noexcept
 

Detailed Description

Definition at line 43 of file Memory.h.

Member Function Documentation

◆ Alloc()

static Block Hubris::Memory::Alloc ( size_t bufSize)
static

Allocates a thread-local block.

◆ AllocShared()

static SharedBlock Hubris::Memory::AllocShared ( size_t size)
static

Allocates a block with syncing constructs.

◆ CreateArena()

static Arena & Hubris::Memory::CreateArena ( size_t size)
static

Creates a thread-local arena.

Parameters
sizeArena size.
Returns
Reference to the new arena.

◆ CreateGlobalArena()

static Arena & Hubris::Memory::CreateGlobalArena ( size_t width)
static

Allocates a shared arena for multi-threaded use.

Parameters
widthArena size.
Returns
A reference to the new arena.

◆ ExpandInternalArena()

static void Hubris::Memory::ExpandInternalArena ( size_t width)
static

Internal use. Arenas are not expandable except the internal arena.

Parameters
widthnew width.

◆ Free()

static void Hubris::Memory::Free ( Block & buffer)
static

Frees a buffer.

◆ FreeArena()

static void Hubris::Memory::FreeArena ( Arena )
static

Attempts to free an areana, if the arean has any blocks in use this call with throw.

◆ GetMemoryAvailable()

static size_t Hubris::Memory::GetMemoryAvailable ( const Arena & arena)
static

◆ IsEngineAllocated()

static bool Hubris::Memory::IsEngineAllocated ( const void * pointer)
static

◆ IsFree()

static bool Hubris::Memory::IsFree ( const Block & block)
staticnoexcept

◆ IsShared()

static bool Hubris::Memory::IsShared ( const void * blockptr)
staticnoexcept

◆ IsThreadLocal()

static bool Hubris::Memory::IsThreadLocal ( const Block & block)
staticnoexcept

◆ IsValid()

static bool Hubris::Memory::IsValid ( const void * pointer)
static

◆ MemoryUsed()

static size_t Hubris::Memory::MemoryUsed ( const Arena & arena)
static

◆ Resize()

static Block Hubris::Memory::Resize ( Block & block,
size_t newSize )
static

Attempts to resize a block, this can move the block to a diffrent location.

If this fails, the original data is unchanged.

If the block is moved, the data is copied and the old block is freed.

Parameters
blockthe block to be resized.
newSizethe new size.
Returns

◆ ThreadAllocationCount()

static unsigned int Hubris::Memory::ThreadAllocationCount ( )
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ThreadArenasAllocated()

static unsigned int Hubris::Memory::ThreadArenasAllocated ( )
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ThreadArenasFreed()

static unsigned int Hubris::Memory::ThreadArenasFreed ( )
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ThreadBlockResizeCount()

static unsigned int Hubris::Memory::ThreadBlockResizeCount ( )
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ThreadDeallocationCount()

static unsigned int Hubris::Memory::ThreadDeallocationCount ( )
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ThreadMemoryFreed()

static size_t Hubris::Memory::ThreadMemoryFreed ( )
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ThreadMemoryUsed()

static size_t Hubris::Memory::ThreadMemoryUsed ( )
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TotalAllocationCount()

static unsigned int Hubris::Memory::TotalAllocationCount ( )
staticnoexcept

◆ TotalArenasAllocated()

static unsigned int Hubris::Memory::TotalArenasAllocated ( )
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TotalArenasFreed()

static unsigned int Hubris::Memory::TotalArenasFreed ( )
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TotalBlockResizeCount()

static unsigned int Hubris::Memory::TotalBlockResizeCount ( )
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TotalDeallocationCount()

static unsigned int Hubris::Memory::TotalDeallocationCount ( )
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TotalMemoryAllocated()

static size_t Hubris::Memory::TotalMemoryAllocated ( )
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TotalMemoryFreed()

static size_t Hubris::Memory::TotalMemoryFreed ( )
staticnoexcept
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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