Jolt Physics
A multi core friendly Game Physics Engine
|
#include <FixedSizeFreeList.h>
Classes | |
struct | Batch |
A batch of objects that can be destructed. More... | |
Public Member Functions | |
~FixedSizeFreeList () | |
Destructor. | |
void | Init (uint inMaxObjects, uint inPageSize) |
Initialize the free list, up to inMaxObjects can be allocated. | |
template<typename... Parameters> | |
uint32 | ConstructObject (Parameters &&... inParameters) |
Lockless construct a new object, inParameters are passed on to the constructor. | |
void | DestructObject (uint32 inObjectIndex) |
Lockless destruct an object and return it to the free pool. | |
void | DestructObject (Object *inObject) |
Lockless destruct an object and return it to the free pool. | |
void | AddObjectToBatch (Batch &ioBatch, uint32 inObjectIndex) |
void | DestructObjectBatch (Batch &ioBatch) |
Lockless destruct batch of objects. | |
Object & | Get (uint32 inObjectIndex) |
Access an object by index. | |
const Object & | Get (uint32 inObjectIndex) const |
Access an object by index. | |
Public Member Functions inherited from NonCopyable | |
NonCopyable ()=default | |
NonCopyable (const NonCopyable &)=delete | |
void | operator= (const NonCopyable &)=delete |
Static Public Attributes | |
static const uint32 | cInvalidObjectIndex = 0xffffffff |
Invalid index. | |
static const int | ObjectStorageSize = sizeof(ObjectStorage) |
Size of an object + bookkeeping for the freelist. | |
Class that allows lock free creation / destruction of objects (unless a new page of objects needs to be allocated) It contains a fixed pool of objects and also allows batching up a lot of objects to be destroyed and doing the actual free in a single atomic operation
|
inline |
Destructor.
|
inline |
Add a object to an existing batch to be destructed. Adding objects to a batch does not destroy or modify the objects, this will merely link them so that the entire batch can be returned to the free list in a single atomic operation
|
inline |
Lockless construct a new object, inParameters are passed on to the constructor.
|
inline |
Lockless destruct an object and return it to the free pool.
|
inline |
Lockless destruct an object and return it to the free pool.
|
inline |
Lockless destruct batch of objects.
|
inline |
Access an object by index.
|
inline |
Access an object by index.
|
inline |
Initialize the free list, up to inMaxObjects can be allocated.
|
static |
Invalid index.
|
static |
Size of an object + bookkeeping for the freelist.