Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
LFHMAllocator Class Reference

Allocator for a lock free hash map. More...

#include <LockFreeHashMap.h>

Inheritance diagram for LFHMAllocator:
NonCopyable

Public Member Functions

 ~LFHMAllocator ()
 Destructor. More...
 
void Init (uint inObjectStoreSizeBytes)
 
void Clear ()
 Clear all allocations. More...
 
void Allocate (uint32 inBlockSize, uint32 &ioBegin, uint32 &ioEnd)
 
template<class T >
uint32 ToOffset (const T *inData) const
 Convert a pointer to an offset. More...
 
template<class T >
T * FromOffset (uint32 inOffset) const
 Convert an offset to a pointer. More...
 
- Public Member Functions inherited from NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
void operator= (const NonCopyable &)=delete
 

Detailed Description

Allocator for a lock free hash map.

Constructor & Destructor Documentation

◆ ~LFHMAllocator()

JPH_NAMESPACE_BEGIN LFHMAllocator::~LFHMAllocator ( )
inline

Destructor.

Member Function Documentation

◆ Allocate()

void LFHMAllocator::Allocate ( uint32  inBlockSize,
uint32 ioBegin,
uint32 ioEnd 
)
inline

Allocate a new block of data

Parameters
inBlockSizeSize of block to allocate (will potentially return a smaller block if memory is full).
ioBeginShould be the start of the first free byte in current memory block on input, will contain the start of the first free byte in allocated block on return.
ioEndShould be the byte beyond the current memory block on input, will contain the byte beyond the allocated block on return.

◆ Clear()

void LFHMAllocator::Clear ( )
inline

Clear all allocations.

◆ FromOffset()

template<class T >
T * LFHMAllocator::FromOffset ( uint32  inOffset) const
inline

Convert an offset to a pointer.

◆ Init()

void LFHMAllocator::Init ( uint  inObjectStoreSizeBytes)
inline

Initialize the allocator

Parameters
inObjectStoreSizeBytesNumber of bytes to reserve for all key value pairs

◆ ToOffset()

template<class T >
uint32 LFHMAllocator::ToOffset ( const T *  inData) const
inline

Convert a pointer to an offset.


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