Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FMemStackBase Class Reference

#include <MemStack.h>

+ Inheritance diagram for FMemStackBase:
+ Collaboration diagram for FMemStackBase:

Classes

struct  FTaggedMemory
 

Public Member Functions

 FMemStackBase ()
 
 FMemStackBase (const FMemStackBase &)=delete
 
 FMemStackBase (FMemStackBase &&Other)
 
FMemStackBaseoperator= (FMemStackBase &&Other)
 
 ~FMemStackBase ()
 
FORCEINLINE uint8PushBytes (size_t AllocSize, size_t Alignment)
 
FORCEINLINE voidAlloc (size_t AllocSize, size_t Alignment)
 
FORCEINLINE bool IsEmpty () const
 
FORCEINLINE void Flush ()
 
FORCEINLINE int32 GetNumMarks ()
 
int32 GetByteCount () const
 
bool ContainsPointer (const void *Pointer) const
 

Protected Attributes

bool bShouldEnforceAllocMarks
 

Private Member Functions

void AllocateNewChunk (int32 MinSize)
 
void FreeChunks (FTaggedMemory *NewTopChunk)
 

Private Attributes

uint8Top
 
uint8End
 
FTaggedMemoryTopChunk
 
class FMemMarkTopMark
 
int32 NumMarks
 

Friends

class FMemMark
 
voidoperator new (size_t Size, FMemStackBase &Mem, int32 Count)
 
voidoperator new (size_t Size, std::align_val_t Align, FMemStackBase &Mem, int32 Count)
 
voidoperator new (size_t Size, FMemStackBase &Mem, EMemZeroed Tag, int32 Count)
 
voidoperator new (size_t Size, std::align_val_t Align, FMemStackBase &Mem, EMemZeroed Tag, int32 Count)
 
voidoperator new (size_t Size, FMemStackBase &Mem, EMemOned Tag, int32 Count)
 
voidoperator new (size_t Size, std::align_val_t Align, FMemStackBase &Mem, EMemOned Tag, int32 Count)
 
voidoperator new[] (size_t Size, FMemStackBase &Mem, int32 Count)
 
voidoperator new[] (size_t Size, std::align_val_t Align, FMemStackBase &Mem, int32 Count)
 
voidoperator new[] (size_t Size, FMemStackBase &Mem, EMemZeroed Tag, int32 Count)
 
voidoperator new[] (size_t Size, std::align_val_t Align, FMemStackBase &Mem, EMemZeroed Tag, int32 Count)
 
voidoperator new[] (size_t Size, FMemStackBase &Mem, EMemOned Tag, int32 Count)
 
voidoperator new[] (size_t Size, std::align_val_t Align, FMemStackBase &Mem, EMemOned Tag, int32 Count)
 

Detailed Description

Simple linear-allocation memory stack. Items are allocated via PushBytes() or the specialized operator new()s. Items are freed en masse by using FMemMark to Pop() them.

Definition at line 77 of file MemStack.h.

Constructor & Destructor Documentation

◆ FMemStackBase() [1/3]

FMemStackBase::FMemStackBase ( )

◆ FMemStackBase() [2/3]

FMemStackBase::FMemStackBase ( const FMemStackBase & )
delete

◆ FMemStackBase() [3/3]

FMemStackBase::FMemStackBase ( FMemStackBase && Other)
inline

Definition at line 84 of file MemStack.h.

◆ ~FMemStackBase()

FMemStackBase::~FMemStackBase ( )
inline

Definition at line 105 of file MemStack.h.

+ Here is the call graph for this function:

Member Function Documentation

◆ Alloc()

FORCEINLINE void * FMemStackBase::Alloc ( size_t AllocSize,
size_t Alignment )
inline

Definition at line 116 of file MemStack.h.

+ Here is the call graph for this function:

◆ AllocateNewChunk()

void FMemStackBase::AllocateNewChunk ( int32 MinSize)
private

Allocate a new chunk of memory of at least MinSize size, updates the memory stack's Chunks table and ActiveChunks counter.

+ Here is the caller graph for this function:

◆ ContainsPointer()

bool FMemStackBase::ContainsPointer ( const void * Pointer) const

◆ Flush()

FORCEINLINE void FMemStackBase::Flush ( )
inline

Definition at line 150 of file MemStack.h.

+ Here is the call graph for this function:

◆ FreeChunks()

void FMemStackBase::FreeChunks ( FTaggedMemory * NewTopChunk)
private

Frees the chunks above the specified chunk on the stack.

+ Here is the caller graph for this function:

◆ GetByteCount()

int32 FMemStackBase::GetByteCount ( ) const
Returns
the number of bytes allocated for this FMemStack that are currently in use.

◆ GetNumMarks()

FORCEINLINE int32 FMemStackBase::GetNumMarks ( )
inline

Definition at line 155 of file MemStack.h.

◆ IsEmpty()

FORCEINLINE bool FMemStackBase::IsEmpty ( ) const
inline

return true if this stack is empty.

Definition at line 145 of file MemStack.h.

◆ operator=()

FMemStackBase & FMemStackBase::operator= ( FMemStackBase && Other)
inline

Definition at line 89 of file MemStack.h.

◆ PushBytes()

FORCEINLINE uint8 * FMemStackBase::PushBytes ( size_t AllocSize,
size_t Alignment )
inline

Definition at line 111 of file MemStack.h.

Friends And Related Symbol Documentation

◆ FMemMark

Definition at line 166 of file MemStack.h.

◆ operator new [1/6]

void * operator new ( size_t Size,
FMemStackBase & Mem,
EMemOned Tag,
int32 Count = 1 )
friend

Definition at line 290 of file MemStack.h.

◆ operator new [2/6]

void * operator new ( size_t Size,
FMemStackBase & Mem,
EMemZeroed Tag,
int32 Count = 1 )
friend

Definition at line 272 of file MemStack.h.

◆ operator new [3/6]

void * operator new ( size_t Size,
FMemStackBase & Mem,
int32 Count = 1 )
friend

Definition at line 258 of file MemStack.h.

◆ operator new [4/6]

void * operator new ( size_t Size,
std::align_val_t Align,
FMemStackBase & Mem,
EMemOned Tag,
int32 Count = 1 )
friend

Definition at line 299 of file MemStack.h.

◆ operator new [5/6]

void * operator new ( size_t Size,
std::align_val_t Align,
FMemStackBase & Mem,
EMemZeroed Tag,
int32 Count = 1 )
friend

Definition at line 281 of file MemStack.h.

◆ operator new [6/6]

void * operator new ( size_t Size,
std::align_val_t Align,
FMemStackBase & Mem,
int32 Count = 1 )
friend

Definition at line 265 of file MemStack.h.

◆ operator new[] [1/6]

void * operator new[] ( size_t Size,
FMemStackBase & Mem,
EMemOned Tag,
int32 Count = 1 )
friend

Definition at line 340 of file MemStack.h.

◆ operator new[] [2/6]

void * operator new[] ( size_t Size,
FMemStackBase & Mem,
EMemZeroed Tag,
int32 Count = 1 )
friend

Definition at line 322 of file MemStack.h.

◆ operator new[] [3/6]

void * operator new[] ( size_t Size,
FMemStackBase & Mem,
int32 Count = 1 )
friend

Definition at line 308 of file MemStack.h.

◆ operator new[] [4/6]

void * operator new[] ( size_t Size,
std::align_val_t Align,
FMemStackBase & Mem,
EMemOned Tag,
int32 Count = 1 )
friend

Definition at line 349 of file MemStack.h.

◆ operator new[] [5/6]

void * operator new[] ( size_t Size,
std::align_val_t Align,
FMemStackBase & Mem,
EMemZeroed Tag,
int32 Count = 1 )
friend

Definition at line 331 of file MemStack.h.

◆ operator new[] [6/6]

void * operator new[] ( size_t Size,
std::align_val_t Align,
FMemStackBase & Mem,
int32 Count = 1 )
friend

Definition at line 315 of file MemStack.h.

Member Data Documentation

◆ bShouldEnforceAllocMarks

bool FMemStackBase::bShouldEnforceAllocMarks
protected

Definition at line 216 of file MemStack.h.

◆ End

uint8* FMemStackBase::End
private

Definition at line 205 of file MemStack.h.

◆ NumMarks

int32 FMemStackBase::NumMarks
private

The number of marks on this stack.

Definition at line 212 of file MemStack.h.

◆ Top

uint8* FMemStackBase::Top
private

Definition at line 204 of file MemStack.h.

◆ TopChunk

FTaggedMemory* FMemStackBase::TopChunk
private

Definition at line 206 of file MemStack.h.

◆ TopMark

class FMemMark* FMemStackBase::TopMark
private

The top mark on the stack.

Definition at line 209 of file MemStack.h.


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