engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
TLockFreeFixedSizeAllocator< SIZE, TPaddingForCacheContention, TTrackingCounter, AllowDisablingOfTrim > 模板类 参考

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

#include <LockFreeFixedSizeAllocator.h>

+ 类 TLockFreeFixedSizeAllocator< SIZE, TPaddingForCacheContention, TTrackingCounter, AllowDisablingOfTrim > 继承关系图:

Public 成员函数

void * Allocate ()
 Allocates a memory block of size SIZE. 更多...
 
void Free (void *Item)
 Puts a memory block previously obtained from Allocate() back on the free list for future use. 更多...
 
const TTrackingCounter & GetNumFree () const
 Gets the number of allocated memory blocks that are currently unused. 更多...
 
const TTrackingCounter & GetNumUsed () const
 Gets the number of allocated memory blocks that are currently in use. 更多...
 
void Trim ()
 Returns all free memory to the heap
 
 ~TLockFreeFixedSizeAllocator ()
 Destructor, returns all memory via FMemory::Free
 

详细描述

template<int32 SIZE, int TPaddingForCacheContention, typename TTrackingCounter = FNoopCounter, bool AllowDisablingOfTrim = false>
class TLockFreeFixedSizeAllocator< SIZE, TPaddingForCacheContention, TTrackingCounter, AllowDisablingOfTrim >

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

成员函数说明

◆ Allocate()

template<int32 SIZE, int TPaddingForCacheContention, typename TTrackingCounter = FNoopCounter, bool AllowDisablingOfTrim = false>
void * TLockFreeFixedSizeAllocator< SIZE, TPaddingForCacheContention, TTrackingCounter, AllowDisablingOfTrim >::Allocate ( )
inline

Allocates a memory block of size SIZE.

返回
Pointer to the allocated memory.
参见
Free

◆ Free()

template<int32 SIZE, int TPaddingForCacheContention, typename TTrackingCounter = FNoopCounter, bool AllowDisablingOfTrim = false>
void TLockFreeFixedSizeAllocator< SIZE, TPaddingForCacheContention, TTrackingCounter, AllowDisablingOfTrim >::Free ( void *  Item)
inline

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

参数
ItemThe item to free.
参见
Allocate

◆ GetNumFree()

template<int32 SIZE, int TPaddingForCacheContention, typename TTrackingCounter = FNoopCounter, bool AllowDisablingOfTrim = false>
const TTrackingCounter & TLockFreeFixedSizeAllocator< SIZE, TPaddingForCacheContention, TTrackingCounter, AllowDisablingOfTrim >::GetNumFree ( ) const
inline

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

返回
Number of unused memory blocks.
参见
GetNumUsed

◆ GetNumUsed()

template<int32 SIZE, int TPaddingForCacheContention, typename TTrackingCounter = FNoopCounter, bool AllowDisablingOfTrim = false>
const TTrackingCounter & TLockFreeFixedSizeAllocator< SIZE, TPaddingForCacheContention, TTrackingCounter, AllowDisablingOfTrim >::GetNumUsed ( ) const
inline

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

返回
Number of used memory blocks.
参见
GetNumFree

该类的文档由以下文件生成: