10#if defined(_ITERATOR_DEBUG_LEVEL) && _ITERATOR_DEBUG_LEVEL > 0
11#error "_ITERATOR_DEBUG_LEVEL" must be defined as "0" for STL containers to be compatible with the ELDEN RING ABI.
14#include <detail/preprocessor.hpp>
222 size_t alignment) = 0;
296template <
typename AllocatorTag>
309template <
typename T,
typename AllocatorTag = default_allocator_tag>
313 using alloc_type = std::conditional_t<std::is_same_v<T, void>, char, T>;
319 return static_cast<const base_type&
>(*this);
323 return this->base().get_allocator();
326 return this->base().get_allocator();
371 template <
typename U>
390 n *
sizeof(alloc_type),
alignof(alloc_type)));
407 template <
typename T1,
typename T2>
416template <
typename T1,
typename T2>
418 return std::addressof(lhs.proxy()) == std::addressof(rhs.proxy());
441 return *this->allocator;
Common ELDEN RING allocator interface.
Definition from_allocator.hpp:42
virtual void unlock()
Unlock the allocator's mutex (if present and accessible).
Definition from_allocator.hpp:264
virtual void * reallocate(void *p, size_t cb)=0
Reallocate a memory block with a new size.
virtual void * allocate_second_aligned(size_t cb, size_t alignment)=0
Allocate a block of at least this many bytes with a given alignment. Use the second allocator if it i...
virtual size_t heap_allocation_count()=0
Total number of objects that have been allocated on the allocator's heap.
virtual int _allocator_id()=0
Unique allocator id sometimes used for comparing allocators.
virtual void * allocate_aligned(size_t cb, size_t alignment)=0
Allocate a block of at least this many bytes with a given alignment.
virtual bool _unknown_bool()
Unknown method, seemingly unused.
Definition from_allocator.hpp:236
virtual void * get_memory_block(void *p)=0
Get the memory block base that this memory belongs to.
virtual void * reallocate_second(void *p, size_t cb)=0
Reallocate a memory block with a new size. Use the second allocator if it is bound,...
virtual void deallocate_second(void *p)=0
Free previously allocated memory. Use the second allocator if it is bound, first if not.
virtual void * allocate(size_t cb)=0
Allocate a block of at least this many bytes.
virtual bool belongs_to_second(void *p)=0
Does memory block belong to the second bound allocator?
virtual size_t heap_size()=0
How many bytes out of the total capacity are allocated.
virtual void _unsupported()
Unknown method, isn't supported by any class that implements DLKR::DLAllocator.
Definition from_allocator.hpp:168
virtual size_t backing_heap_capacity()=0
The remaining capacity of the backing heap.
virtual void deallocate(void *p)=0
Free previously allocated memory.
virtual std::bitset< 8 > heap_flags()=0
Allocator and heap compatibility flags.
virtual bool belongs_to_first(void *p)=0
Does memory block belong to the first bound allocator?
virtual int _unused()
Unknown function which is defined in the interface, never overriden or used.
Definition from_allocator.hpp:59
virtual size_t msize(void *p)=0
Check how big a given memory block is.
virtual void * allocate_second(size_t cb)=0
Allocate a block of at least this many bytes. Use the second allocator if it is bound,...
virtual void * reallocate_aligned(void *p, size_t cb, size_t alignment)=0
Reallocate an aligned memory block with a new size.
virtual void * reallocate_second_aligned(void *p, size_t cb, size_t alignment)=0
Reallocate an aligned memory block with a new size. Use the second allocator if it is bound,...
virtual void lock()
Lock the allocator's mutex (if present and accessible).
Definition from_allocator.hpp:258
virtual size_t heap_capacity()=0
The total capacity of the heap, in bytes.
Definition from_allocator.hpp:297
The main libER stand-in for ER allocator proxies.
Definition from_allocator.hpp:310
allocator(DLKR::DLAllocator *dl_allocator) noexcept
Wrap an existing DLKR::DLAllocator.
Definition from_allocator.hpp:379
size_t size_type
Memory size type.
Definition from_allocator.hpp:340
T value_type
The allocated value type.
Definition from_allocator.hpp:334
ptrdiff_t difference_type
Memory difference type.
Definition from_allocator.hpp:346
allocator(const allocator< U > &other) noexcept
Allocator copy constructor.
Definition from_allocator.hpp:372
std::false_type is_always_equal
This allocator may proxy different stateful allocators.
Definition from_allocator.hpp:359
std::true_type propagate_on_container_move_assignment
This allocator is move assigned along with the contents.
Definition from_allocator.hpp:352
void deallocate(T *p, size_type n=0)
Deallocate previously allocated memory.
Definition from_allocator.hpp:399
T * allocate(size_type n)
Allocate n instances of uninitialized memory for T.
Definition from_allocator.hpp:388
friend bool operator==(const allocator< T1 > &lhs, const allocator< T2 > &rhs) noexcept
Allocator equality comparison friend declaration.
Definition from_allocator.hpp:417
Definition from_allocator.hpp:277
Default libER allocator that gets embedded in objects as needed for ER ABI compatibility.
Definition from_allocator.hpp:285
Default libER allocator with an empty base.
Definition from_allocator.hpp:294