UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TLockFreeClassAllocator< T, TPaddingForCacheContention > Class Template Reference

#include <LockFreeFixedSizeAllocator.h>

+ Inheritance diagram for TLockFreeClassAllocator< T, TPaddingForCacheContention >:

Public Member Functions

voidAllocate ()
 
T * New ()
 
void Free (T *Item)
 

Detailed Description

template<class T, int TPaddingForCacheContention>
class TLockFreeClassAllocator< T, TPaddingForCacheContention >

Thread safe, lock free pooling allocator of memory for instances of T.

Never returns free space until program shutdown.

Member Function Documentation

◆ Allocate()

template<class T , int TPaddingForCacheContention>
void * TLockFreeClassAllocator< T, TPaddingForCacheContention >::Allocate ( )
inline

Returns a memory block of size sizeof(T).

Returns
Pointer to the allocated memory.
See also
Free, New

◆ Free()

template<class T , int TPaddingForCacheContention>
void TLockFreeClassAllocator< T, TPaddingForCacheContention >::Free ( T *  Item)
inline

Calls a destructor on Item and returns the memory to the free list for recycling.

Parameters
ItemThe item whose memory to free.
See also
Allocate, New

◆ New()

template<class T , int TPaddingForCacheContention>
T * TLockFreeClassAllocator< T, TPaddingForCacheContention >::New ( )
inline

Returns a new T using the default constructor.

Returns
Pointer to the new object.
See also
Allocate, Free

The documentation for this class was generated from the following file: