FBulkDataAllocation

This is a wrapper for the BulkData memory allocation so we can use a single pointer to either reference a straight memory allocation or in the case that the BulkData object represents a memory mapped file region, a [FOwnedBulkDataPtr](API\Runtime\CoreUObject\Serialization\FOwnedBulkDataPtr).

Windows
MacOS
Linux

References

Module

CoreUObject

Header

/Engine/Source/Runtime/CoreUObject/Public/Serialization/BulkData2.h

Include

#include "Serialization/BulkData2.h"

Syntax

class FBulkDataAllocation

Remarks

This is a wrapper for the BulkData memory allocation so we can use a single pointer to either reference a straight memory allocation or in the case that the BulkData object represents a memory mapped file region, a FOwnedBulkDataPtr. This makes the code more complex but it means that we do not pay any additional memory cost when memory mapping isn't being used at a small cpu cost. However the number of BulkData object usually means that the memory saving is worth it compared to how infrequently the memory accessors are actually called.

We use a flag set in the owning BulkData object to tell us what storage type we are using so all accessors require that a pointer to the parent object be passed in.

Functions

Name Description

Public function

void *

 

AllocateData

(
    FBulkDataBase* Owner,
    SIZE_T SizeInBytes
)

Set as a raw buffer.

Public function

void

 

Free

(
    FBulkDataBase* Owner
)

Public function Const

void *

 

GetAllocationForWrite

(
    const FBulkDataBase* Owner
)

Getters.

Public function Const

const void &...

 

GetAllocationReadOnly

(
    const FBulkDataBase* Owner
)

Public function Const

bool

 

IsLoaded()

Misc.

Public function

void *

 

ReallocateData

(
    FBulkDataBase* Owner,
    SIZE_T SizeInBytes
)

Public function

void

 

SetData

(
    FBulkDataBase* Owner,
    void* Buffer
)

Public function

void

 

SetMemoryMappedData

(
    FBulkDataBase* Owner,
    IMappedFileHandle* MappedHandl...,
    IMappedFileRegion* MappedRegio...
)

Set as memory mapped.

Public function

FOwnedBulkDa...

 

StealFileMapping

(
    FBulkDataBase* Owner
)

Public function

void

 

Swap

(
    FBulkDataBase* Owner,
    void** DstBuffer
)

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