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>
310 using alloc_type = std::conditional_t<std::is_same_v<T, void>, char, T>;
350 allocator() noexcept : base(&DLKR::get_base_allocator()) {}
369 template <
typename U>
378 : base(allocator_base) {}
388 n *
sizeof(alloc_type),
alignof(alloc_type)));
398 this->base->
deallocate(
static_cast<void*
>(p));
405 template <
typename T1,
typename T2>
414template <
typename T1,
typename T2>
416 return lhs.base == rhs.base;
428 &DLKR::get_dlallocator_of(
static_cast<const void*
>(p)));
Common ELDEN RING allocator interface.
Definition from_allocator.hpp:37
virtual size_t get_heap_backing_capacity()=0
The remaining capacity of the backing heap.
virtual size_t get_heap_allocation_count()=0
Total number of objects that have been allocated on the allocator's heap.
virtual int & get_heap_flags(int &flags)=0
Allocator and heap compatibility flags.
virtual void * get_block(void *p)=0
Get the memory block that this memory belongs to.
virtual void * reallocate2_aligned(void *p, size_t cb, size_t alignment)
Reallocate an aligned memory block with a new size. Use the second allocator if it is bound,...
Definition from_allocator.hpp:220
virtual size_t get_heap_size()=0
How many bytes out of the total capacity are allocated.
virtual void * reallocate(void *p, size_t cb)=0
Reallocate a memory block with a new size.
virtual void * allocate2_aligned(size_t cb, size_t alignment)
Allocate a block of at least this many bytes with a given alignment. Use the second allocator if it i...
Definition from_allocator.hpp:189
virtual void _unk0x70()
Unknown method, isn't supported by any class that implements DLKR::DLAllocator.
Definition from_allocator.hpp:163
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 void * reallocate2(void *p, size_t cb)
Reallocate a memory block with a new size. Use the second allocator if it is bound,...
Definition from_allocator.hpp:204
virtual bool check_owned(void *p)=0
Does the pointed to memory block belong to this allocator?
virtual int get_allocator_id()=0
Unique allocator id sometimes used for comparing allocators.
virtual size_t get_heap_capacity()=0
The total capacity of the heap, in bytes.
virtual void * allocate(size_t cb)=0
Allocate a block of at least this many bytes.
virtual int _unk0x10()
Unknown function which is defined in the interface, never overriden or used.
Definition from_allocator.hpp:54
virtual void deallocate(void *p)=0
Free previously allocated memory.
virtual void deallocate2(void *p)
Free previously allocated memory. Use the second allocator if it is bound, first if not.
Definition from_allocator.hpp:230
virtual void lock()=0
Lock the allocator's mutex (if present and accessible).
virtual size_t msize(void *p)=0
Check how big a given memory block is.
virtual bool _unk0xB0(std::nullptr_t)
Seemingly unused.
Definition from_allocator.hpp:252
virtual void * reallocate_aligned(void *p, size_t cb, size_t alignment)=0
Reallocate an aligned memory block with a new size.
virtual void unlock()=0
Unlock the allocator's mutex (if present and accessible).
virtual void * allocate2(size_t cb)
Allocate a block of at least this many bytes. Use the second allocator if it is bound,...
Definition from_allocator.hpp:174
virtual bool _unk0xA0()
Unknown method, seemingly unused.
Definition from_allocator.hpp:238
The main libER stand-in for ER allocator proxies.
Definition from_allocator.hpp:308
allocator(const allocator< U > &other) noexcept
Allocator copy constructor.
Definition from_allocator.hpp:370
T value_type
The allocated value type.
Definition from_allocator.hpp:319
std::false_type is_always_equal
This allocator may proxy different stateful allocators.
Definition from_allocator.hpp:344
allocator() noexcept
Default allocator constructor.
Definition from_allocator.hpp:350
T * allocate(size_type n)
Allocate n instances of uninitialized memory for T.
Definition from_allocator.hpp:386
std::true_type propagate_on_container_move_assignment
This allocator is move assigned along with the contents.
Definition from_allocator.hpp:337
void deallocate(T *p, size_type n=0)
Deallocate previously allocated memory.
Definition from_allocator.hpp:397
ptrdiff_t difference_type
Memory difference type.
Definition from_allocator.hpp:331
size_t size_type
Memory size type.
Definition from_allocator.hpp:325
allocator(base_type *allocator_base) noexcept
Wrap an existing DLKR::DLAllocator.
Definition from_allocator.hpp:377
friend bool operator==(const allocator< T1 > &lhs, const allocator< T2 > &rhs) noexcept
Allocator equality comparison.
Definition from_allocator.hpp:415
allocator(const allocator &other) noexcept
Allocator copy constructor.
Definition from_allocator.hpp:359
LIBERAPI DLAllocator & get_base_allocator() noexcept
Get a compatible ELDEN RING base allocator.
from::allocator< T > get_allocator_of(const T *p) noexcept
Get the allocator of an object allocated by ELDEN RING.
Definition from_allocator.hpp:426
LIBERAPI DLAllocator & get_dlallocator_of(const void *p) noexcept
Get the allocator of memory allocated by ELDEN RING.