FMemoryChunk

Contains information of a single allocation or free block.

Windows
MacOS
Linux

References

Module

RHI

Header

/Engine/Source/Runtime/RHI/Public/GPUDefragAllocator.h

Include

#include "GPUDefragAllocator.h"

Syntax

class FMemoryChunk

Remarks

Contains information of a single allocation or free block.

Variables

Name Description

Public variable

uint8 *

 

Base

Base of chunk.

Public variable

FGPUDefragAlloc...

 

BestFitAllocator

Allows access to FBestFitAllocator members such as FirstChunk, FirstFreeChunk and LastChunk.

Public variable

bool

 

bIsAvailable

Whether the chunk is available.

Public variable

bool

 

bTail

Public variable

uint16

 

DefragCounter

Defrag counter. If this chunk failed to defrag, it won't try it again until the counter is 0.

Public variable

int32

 

LockCount

Whether the chunk has been locked.

Public variable

FMemoryChunk &#...

 

NextChunk

Pointer to next chunk.

Public variable

FMemoryChunk &#...

 

NextFreeChunk

Pointer to next free chunk.

Public variable

int64

 

OrigSize

Public variable

FMemoryChunk &#...

 

PreviousChunk

Pointer to previous chunk.

Public variable

FMemoryChunk &#...

 

PreviousFreeChunk

Pointer to previous free chunk.

Public variable

int64

 

Size

Size of chunk.

Public variable

TStatId

 

Stat

Stat associated with this allocation

Public variable

uint32

 

SyncIndex

SyncIndex that must be exceeded before accessing the data within this chunk.

Public variable

int64

 

SyncSize

Number of uint8s covered by the SyncIndex (starting from the beginning of the chunk).

Public variable

void *

 

UserPayload

User payload, e.g. platform-specific texture Pointer. Only chunks with payload can be relocated.

Constructors

Name Description

Public function

FMemoryChunk

(
    uint8* InBase,
    int64 InSize,
    FGPUDefragAllocator& InBestFitAllo...,
    FMemoryChunk*& ChunkToInsertAf...,
    TStatId InStat
)

Private constructor.

Destructors

Name Description

Public function

~FMemoryChunk()

Unlinks/ removes the chunk from the linked lists it belongs to.

Functions

Name Description

Public function Static

uint64

 

Compare

(
    const FMemoryChunk* A,
    const FMemoryChunk* B
)

Comparison function for Sort(), etc, based on increasing base address.

Public function Const

int64

 

GetAvailableSize()

Returns the number of uint8s that can be allocated from this chunk.

Public function Const

int64

 

GetFinalSize()

Returns the current size (in uint8s), or the final size if it has a reallocating request.

Public function Const

uint32

 

GetSyncIndex()

Returns the relocation sync index.

Public function Const

bool

 

IsLocked()

Public function Const

bool

 

IsRelocating()

Returns true if the Chunk is being asynchronously relocated due to reallocation or defrag.

Public function

void

 

Link

(
    FMemoryChunk*& ChunkToInsertAf...
)

Inserts this chunk after the passed in one.

Public function

void

 

LinkFree

(
    FMemoryChunk* FirstFreeChunkTo...
)

Inserts this chunk at the head of the free chunk list.

Public function

void

 

SetSyncIndex

(
    uint32 InSyncIndex,
    int64 InSyncSize
)

Sets the relocation sync index.

Public function

void

 

Unlink()

Removes itself for linked list.

Public function

void

 

UnlinkFree()

Removes itself for linked "free" list. Maint32ains the free-list order.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss