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

#include <LockFreeHashMap.h>

Inheritance diagram for LFHMAllocatorContext:
NonCopyable ContactConstraintManager::ContactAllocator

Public Member Functions

 LFHMAllocatorContext (LFHMAllocator &inAllocator, uint32 inBlockSize)
 Construct a new allocator context. More...
 
bool Allocate (uint32 inSize, uint32 inAlignment, uint32 &outWriteOffset)
 Allocate data block. More...
 
- Public Member Functions inherited from NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
void operator= (const NonCopyable &)=delete
 

Detailed Description

Allocator context object for a lock free hash map that allocates a larger memory block at once and hands it out in smaller portions. This avoids contention on the atomic LFHMAllocator::mWriteOffset.

Constructor & Destructor Documentation

◆ LFHMAllocatorContext()

LFHMAllocatorContext::LFHMAllocatorContext ( LFHMAllocator inAllocator,
uint32  inBlockSize 
)
inline

Construct a new allocator context.

Member Function Documentation

◆ Allocate()

bool LFHMAllocatorContext::Allocate ( uint32  inSize,
uint32  inAlignment,
uint32 outWriteOffset 
)
inline

Allocate data block.

Parameters
inSizeSize of block to allocate.
inAlignmentAlignment of block to allocate.
outWriteOffsetOffset in buffer where block is located
Returns
True if allocation succeeded

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