UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
uLang::CArenaAllocator Class Reference

#include <ArenaAllocator.h>

+ Inheritance diagram for uLang::CArenaAllocator:

Classes

struct  SArenaHeader
 Header of an arena, the allocated memory follows. More...
 

Public Member Functions

UE_API CArenaAllocator (uint32_t ArenaSize)
 
UE_API ~CArenaAllocator ()
 
UE_API void Merge (CArenaAllocator &&Other)
 
voidAllocate (uint32_t NumBytes)
 
UE_API void DeallocateAll ()
 
- Public Member Functions inherited from uLang::CAllocatorInstance
 CAllocatorInstance (FAllocate Allocate, FReallocate Reallocate, FDeallocate Deallocate)
 Use the memory address of this object to seed the observer id generator.
 
ULANG_FORCEINLINE voidAllocate (size_t NumBytes) const
 
ULANG_FORCEINLINE voidReallocate (void *Memory, size_t NumBytes) const
 
ULANG_FORCEINLINE void Deallocate (void *Memory) const
 
ULANG_FORCEINLINE EObserverId GenerateObserverId ()
 

Protected Types

enum  { Alignment = 8 }
 

Protected Member Functions

UE_API void AllocateNewArena ()
 

Static Protected Member Functions

static UE_API voidAllocate (const CAllocatorInstance *This, size_t NumBytes)
 
static UE_API voidReallocate (const CAllocatorInstance *This, void *Memory, size_t NumBytes)
 
static UE_API void Deallocate (const CAllocatorInstance *This, void *Memory)
 

Protected Attributes

SArenaHeader_First
 The first in the list of arenas.
 
const uint32_t _ArenaSize
 Memory in each arena, in bytes.
 
uint32_t _BytesLeftInFirstArena
 How much memory is available in the first arena.
 

Additional Inherited Members

- Public Types inherited from uLang::CAllocatorInstance
using FAllocate = void *(*)(const CAllocatorInstance *, size_t)
 
using FReallocate = void *(*)(const CAllocatorInstance *, void *, size_t)
 
using FDeallocate = void(*)(const CAllocatorInstance *, void *)
 

Detailed Description

Allocates from a series of arenas Memory blocks can not be individually deallocated Deleting this allocator will free all allocated memory NOT thread safe (on purpose, for efficiency)

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
Alignment 

Constructor & Destructor Documentation

◆ CArenaAllocator()

uLang::CArenaAllocator::CArenaAllocator ( uint32_t  ArenaSize)

◆ ~CArenaAllocator()

uLang::CArenaAllocator::~CArenaAllocator ( )

Member Function Documentation

◆ Allocate() [1/2]

void * uLang::CArenaAllocator::Allocate ( const CAllocatorInstance This,
size_t  NumBytes 
)
staticprotected

◆ Allocate() [2/2]

ULANG_FORCEINLINE void * uLang::CArenaAllocator::Allocate ( uint32_t  NumBytes)

◆ AllocateNewArena()

void uLang::CArenaAllocator::AllocateNewArena ( )
protected

◆ Deallocate()

void uLang::CArenaAllocator::Deallocate ( const CAllocatorInstance This,
void Memory 
)
staticprotected

◆ DeallocateAll()

void uLang::CArenaAllocator::DeallocateAll ( )

◆ Merge()

void uLang::CArenaAllocator::Merge ( CArenaAllocator &&  Other)

◆ Reallocate()

void * uLang::CArenaAllocator::Reallocate ( const CAllocatorInstance This,
void Memory,
size_t  NumBytes 
)
staticprotected

Member Data Documentation

◆ _ArenaSize

const uint32_t uLang::CArenaAllocator::_ArenaSize
protected

Memory in each arena, in bytes.

◆ _BytesLeftInFirstArena

uint32_t uLang::CArenaAllocator::_BytesLeftInFirstArena
protected

How much memory is available in the first arena.

◆ _First

SArenaHeader* uLang::CArenaAllocator::_First
protected

The first in the list of arenas.


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