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 | |
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
|
inline |
|
inline |
Puts a memory block previously obtained from Allocate() back on the free list for future use.
| Item | The item to free. |
|
inline |
Gets the number of allocated memory blocks that are currently unused.
|
inline |
Gets the number of allocated memory blocks that are currently in use.