|
siplasplas
A library for C++ reflection and introspection
|
Implements fixed-size with fallback to dynamic allocation. More...
#include <siplasplas/typeerasure/anystorage/deadpool.hpp>
Public Member Functions | |
| void * | storage (cpp::typeerasure::TypeInfo typeInfo) const |
| template<typename T > | |
| constexpr bool | objectFitsInStorage () const |
| std::size_t | dynamicAllocStorageSize () const |
Implements fixed-size with fallback to dynamic allocation.
DeadPoolStorage implements a fixed-size storage similar to FixedSizeStorage but that switches to dynamic allocation if there's no enough space in the fixed-size storage to allocate the object
Dynamic allocation is performed through cpp::detail::aligned_malloc()
| PreAllocatedSize | Max capacity of the storage |
| PreAllocatedAlignment | Storage alignment. Alignof(std::uint8_t) by default |