Jolt Physics
A multi core friendly Game Physics Engine
|
STL allocator that forwards to our allocation functions. More...
#include <STLAllocator.h>
Classes | |
struct | rebind |
Converting to allocator for other type. More... | |
Public Types | |
using | value_type = T |
using | pointer = T * |
Pointer to type. | |
using | const_pointer = const T * |
using | reference = T & |
using | const_reference = const T & |
using | size_type = size_t |
using | difference_type = ptrdiff_t |
using | is_always_equal = std::true_type |
The allocator is stateless. | |
using | propagate_on_container_move_assignment = std::true_type |
Allocator supports moving. | |
Public Member Functions | |
STLAllocator ()=default | |
Constructor. | |
template<typename T2 > | |
STLAllocator (const STLAllocator< T2 > &) | |
Constructor from other allocator. | |
pointer | allocate (size_type inN) |
Allocate memory. | |
template<bool has_reallocate_v = has_reallocate, typename = std::enable_if_t<has_reallocate_v>> | |
pointer | reallocate (pointer inOldPointer, size_type inOldSize, size_type inNewSize) |
Reallocate memory. | |
void | deallocate (pointer inPointer, size_type) |
Free memory. | |
bool | operator== (const STLAllocator< T > &) const |
Allocators are stateless so assumed to be equal. | |
bool | operator!= (const STLAllocator< T > &) const |
Static Public Attributes | |
static constexpr bool | needs_aligned_allocate = alignof(T) > (JPH_CPU_ADDRESS_BITS == 32? 8 : 16) |
If this allocator needs to fall back to aligned allocations because the type requires it. | |
static constexpr bool | has_reallocate = std::is_trivially_copyable<T>() && !needs_aligned_allocate |
Should we expose a reallocate function? | |
STL allocator that forwards to our allocation functions.
using STLAllocator< T >::const_pointer = const T * |
using STLAllocator< T >::const_reference = const T & |
using STLAllocator< T >::difference_type = ptrdiff_t |
using STLAllocator< T >::is_always_equal = std::true_type |
The allocator is stateless.
using STLAllocator< T >::pointer = T * |
Pointer to type.
using STLAllocator< T >::propagate_on_container_move_assignment = std::true_type |
Allocator supports moving.
using STLAllocator< T >::reference = T & |
Reference to type. Can be removed in C++20.
using STLAllocator< T >::size_type = size_t |
using STLAllocator< T >::value_type = T |
|
inlinedefault |
Constructor.
|
inline |
Constructor from other allocator.
|
inline |
Allocate memory.
|
inline |
Free memory.
|
inline |
|
inline |
Allocators are stateless so assumed to be equal.
|
inline |
Reallocate memory.
|
staticconstexpr |
Should we expose a reallocate function?
|
staticconstexpr |
If this allocator needs to fall back to aligned allocations because the type requires it.