TLockFreeFixedSizeAllocator

Thread safe, lock free pooling allocator of fixed size blocks that never returns free space until program shutdown.

Windows
MacOS
Linux

Inheritance Hierarchy

TLockFreeFixedSizeAllocator

TLockFreeClassAllocator

Syntax

template<int32 SIZE, int TPaddingForCacheContention, typename TTrackingCounter>
class TLockFreeFixedSizeAllocator

Remarks

Thread safe, lock free pooling allocator of fixed size blocks that never returns free space until program shutdown. alignment isn't handled, assumes FMemory::Malloc will work

Destructors

Name Description

Public function

~TLockFreeFixedSizeAllocator()

Destructor, returns all memory via FMemory::Free

Functions

Name Description

Public function

void *

 

Allocate()

Allocates a memory block of size SIZE.

Public function

void

 

Free

(
    void* Item
)

Puts a memory block previously obtained from Allocate() back on the free list for future use.

Public function Const

const TTrack...

 

GetNumFree()

Gets the number of allocated memory blocks that are currently unused.

Public function Const

const TTrack...

 

GetNumUsed()

Gets the number of allocated memory blocks that are currently in use.

Public function

void

 

Trim()

Returns all free memory to the heap

References

Module

Core

Header

Runtime/Core/Public/Containers/LockFreeFixedSizeAllocator.h

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback