TConcurrentLinearAllocator

This concurrent fast linear Allocator can be used for temporary allocations that are usually produced and consumed on different threads and within the lifetime of a frame.

Choose your operating system:

Windows

macOS

Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Experimental/ConcurrentLinearAllocator.h

Include

#include "Experimental/ConcurrentLinearAllocator.h"

Syntax

template<typename BlockAllocationTag>
class TConcurrentLinearAllocator

Remarks

This concurrent fast linear Allocator can be used for temporary allocations that are usually produced and consumed on different threads and within the lifetime of a frame. Although the lifetime of any individual Allocation is not hard tied to a frame (tracking is done using the FBlockHeader::NumAllocations atomic variable) the Application will eventually run OOM if Allocations are not cleaned up in a timely manner. The Allocator works by allocating a larger block in TLS which has a Header at the front which contains the Atomic and all allocations are than allocated from this block: | FBlockHeader(atomic counter etc.) | Alignment Waste | FAllocationHeader(size) | Memory used for Allocation | Alignment Waste | FAllocationHeader(size) | Memory used for Allocation | FreeSpace ...

Functions

Name Description

Public function Static

void

 

Free

(
    void* Pointer
)

Public function Static

SIZE_T

 

GetAllocationSize

(
    void* Pointer
)

Public function Static

void *

 

Malloc

(
    SIZE_T Size
)

Public function Static

void *

 

Malloc

(
    SIZE_T Size,
    uint32 Alignment
)

Public function Static

void *

 

Realloc

(
    void* Old,
    SIZE_T Size,
    uint32 Alignment
)