Navigation
API > API/Runtime > API/Runtime/Engine
Chunked handle table with generational ABA protection.
Storage is backed by TLockFreeAllocOnceIndexedAllocator (chunked pages, pointer-stable GetItem). Slot allocation (FreeList pop / NextIndex++) and lazy page materialization share a single mutex. Serializing producers guarantees a newly-allocated slot's memory is fully initialized before any consumer observes the slot index; register/unregister traffic isn't hot enough to justify a lockless design at this layer.
GetIndex / SetIndex / IsValid are lock-free on the slot's own atomics (generation + registration index); these are called outside Allocate/Release and don't need the table-level mutex. GetIndex additionally range-checks the handle against an atomic NextIndex (release-stored after page materialization in Allocate), rejecting forged or corrupted handles before any storage access.
Generation-based ABA protection: every Release bumps the slot's Generation, invalidating every outstanding copy of the previous handle. A stale handle (generation mismatch):
- Returns INDEX_NONE from GetIndex.
- Silently no-ops in SetIndex (no clobber of a recycled slot).
- Silently no-ops in Release (no double-bump, no double-push to the free list). These checks are enforced with real runtime logic, not check() macros, so the protection holds in shipping builds.
| Name | TSSAMHandleTable |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Public/Streaming/SimpleStreamableAssetManagerHandle.h |
| Include Path | #include "Streaming/SimpleStreamableAssetManagerHandle.h" |
Syntax
template<typename HandleT>
class TSSAMHandleTable
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FStorage | TLockFreeAllocOnceIndexedAllocator< FSSAMSlot, MaxSlots, SlotsPerPage > | Streaming/SimpleStreamableAssetManagerHandle.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| MaxSlots | uint32 | Streaming/SimpleStreamableAssetManagerHandle.h | |
| SlotsPerPage | uint32 | Streaming/SimpleStreamableAssetManagerHandle.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| FreeList | TArray< uint32 > | Streaming/SimpleStreamableAssetManagerHandle.h | ||
| Mutex | UE::FMutex | Streaming/SimpleStreamableAssetManagerHandle.h | ||
| NextIndex | std::atomic< uint32 > | Monotonic high-water mark of slot indices ever issued. | Streaming/SimpleStreamableAssetManagerHandle.h | |
| NextMaterializedItem | uint32 | Streaming/SimpleStreamableAssetManagerHandle.h | ||
| SlotStorage | FStorage | SlotStorage is mutable because TLockFreeAllocOnceIndexedAllocator declares GetItem non-const even though it's semantically a read-only atomic load. | Streaming/SimpleStreamableAssetManagerHandle.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
HandleT Allocate() |
Streaming/SimpleStreamableAssetManagerHandle.h | ||
uint32 GetAllocatedSize() |
Streaming/SimpleStreamableAssetManagerHandle.h | ||
int32 GetIndex
(
HandleT SSAMHandle |
Streaming/SimpleStreamableAssetManagerHandle.h | ||
bool IsValid
(
HandleT SSAMHandle |
Streaming/SimpleStreamableAssetManagerHandle.h | ||
int32 Release
(
HandleT SSAMHandle |
Invalidate the handle and recycle the slot. | Streaming/SimpleStreamableAssetManagerHandle.h | |
void SetIndex
(
HandleT SSAMHandle, |
Store a new registration index. | Streaming/SimpleStreamableAssetManagerHandle.h |