Navigation
API > API/Runtime > API/Runtime/Core
Accessor for a LinearBlockAllocator when multithreading. Every thread using the Allocator must access it through its own FLinearBlockAllocatorThreadAccessor.
Intended use is to share an allocator amongst the task threads used within a single function in e.g. ParallelFor.
The lifetime of FLinearBlockAllocatorThreadAccessor must be within the lifetime of the Allocator, an assertion fires if FLinearBlockAllocatorThreadAccessor are still allocated when the Allocator is destructed. So the thread that destroys the FLinearBlockAllocator must wait for all other threads using the Allocator to destroy their FLinearBlockAllocatorThreadAccessor.
| Name | FLinearBlockAllocatorThreadAccessor |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Memory/LinearAllocator.h |
| Include Path | #include "Memory/LinearAllocator.h" |
Syntax
class FLinearBlockAllocatorThreadAccessor : public FNoncopyable
Inheritance Hierarchy
- FNoncopyable → FLinearBlockAllocatorThreadAccessor
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FLinearBlockAllocatorThreadAccessor
(
FLinearBlockAllocator& InAllocator |
Memory/LinearAllocator.h | ||
| Memory/LinearAllocator.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FLinearBlockAllocatorThreadAccessor() |
Memory/LinearAllocator.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Allocator | FLinearBlockAllocator * | Memory/LinearAllocator.h | ||
| LastHeader | FLinearBlockAllocator::FBlock * | Memory/LinearAllocator.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void * Malloc
(
SIZE_T Size, |
Memory/LinearAllocator.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FLinearBlockAllocatorThreadAccessor & operator=
(
FLinearBlockAllocatorThreadAccessor&& Other |
Copy constructor/assignment is disabled because each copy needs to get its own LastBlock from the allocator. | Memory/LinearAllocator.h |