libER 0.1.4.2
ELDEN RING API library
Loading...
Searching...
No Matches
Public Member Functions | List of all members
from::DLKR::DLAllocator Class Referenceabstract

Common ELDEN RING allocator interface. More...

#include <from_allocator.hpp>

Public Member Functions

virtual int get_allocator_id ()=0
 Unique allocator id sometimes used for comparing allocators.
 
virtual int _unk0x10 ()
 Unknown function which is defined in the interface, never overriden or used.
 
virtual intget_heap_flags (int &flags)=0
 Allocator and heap compatibility flags.
 
virtual size_t get_heap_capacity ()=0
 The total capacity of the heap, in bytes.
 
virtual size_t get_heap_size ()=0
 How many bytes out of the total capacity are allocated.
 
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 size_t msize (void *p)=0
 Check how big a given memory block is.
 
virtual voidallocate (size_t cb)=0
 Allocate a block of at least this many bytes.
 
virtual voidallocate_aligned (size_t cb, size_t alignment)=0
 Allocate a block of at least this many bytes with a given alignment.
 
virtual voidreallocate (void *p, size_t cb)=0
 Reallocate a memory block with a new size.
 
virtual voidreallocate_aligned (void *p, size_t cb, size_t alignment)=0
 Reallocate an aligned memory block with a new size.
 
virtual void deallocate (void *p)=0
 Free previously allocated memory.
 
virtual void _unk0x70 ()
 Unknown method, isn't supported by any class that implements DLKR::DLAllocator.
 
virtual voidallocate2 (size_t cb)
 Allocate a block of at least this many bytes. Use the second allocator if it is bound, first if not.
 
virtual voidallocate2_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 is bound, first if not.
 
virtual voidreallocate2 (void *p, size_t cb)
 Reallocate a memory block with a new size. Use the second allocator if it is bound, first if not.
 
virtual voidreallocate2_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, first if not.
 
virtual void deallocate2 (void *p)
 Free previously allocated memory. Use the second allocator if it is bound, first if not.
 
virtual bool _unk0xA0 ()
 Unknown method, seemingly unused.
 
virtual bool check_owned (void *p)=0
 Does the pointed to memory block belong to this allocator?
 
virtual bool _unk0xB0 (std::nullptr_t)
 Seemingly unused.
 
virtual void lock ()=0
 Lock the allocator's mutex (if present and accessible).
 
virtual void unlock ()=0
 Unlock the allocator's mutex (if present and accessible).
 
virtual voidget_block (void *p)=0
 Get the memory block that this memory belongs to.
 

Detailed Description

Common ELDEN RING allocator interface.

DLKR::DLAllocator is the common allocator interface used by ER allocators, which are statically allocated in the binary and referenced by stateless proxy objects. from::allocator<T> provides a proxy object that fulfils Allocator completeness requirements and uses the DLKR::DLAllocator interface. Due to implementing _msize (actively used, see CS::CSGrassAllocator) the default allocator proxied by from::allocator cannot be based on std::allocator<T>.

May support two allocators at once (for container allocation).

Member Function Documentation

◆ _unk0x10()

virtual int from::DLKR::DLAllocator::_unk0x10 ( )
inlinevirtual

Unknown function which is defined in the interface, never overriden or used.

Returns
int unknown

◆ allocate()

virtual void * from::DLKR::DLAllocator::allocate ( size_t  cb)
pure virtual

Allocate a block of at least this many bytes.

Note
An alignment of at least 16 bytes is expected by ELDEN RING.
Parameters
cbthe number of bytes to allocate
Returns
void* pointer to the allocated memory

◆ allocate2()

virtual void * from::DLKR::DLAllocator::allocate2 ( size_t  cb)
inlinevirtual

Allocate a block of at least this many bytes. Use the second allocator if it is bound, first if not.

Note
An alignment of at least 16 bytes is expected by ELDEN RING.
Parameters
cbthe number of bytes to allocate
Returns
void* pointer to the allocated memory

◆ allocate2_aligned()

virtual void * from::DLKR::DLAllocator::allocate2_aligned ( size_t  cb,
size_t  alignment 
)
inlinevirtual

Allocate a block of at least this many bytes with a given alignment. Use the second allocator if it is bound, first if not.

Note
An alignment of at least 16 bytes is expected by ELDEN RING.
Parameters
cbthe number of bytes to allocate
alignmentthe alignment of the allocated memory
Returns
void* pointer to the allocated memory

◆ allocate_aligned()

virtual void * from::DLKR::DLAllocator::allocate_aligned ( size_t  cb,
size_t  alignment 
)
pure virtual

Allocate a block of at least this many bytes with a given alignment.

Note
An alignment of at least 16 bytes is expected by ELDEN RING.
Parameters
cbthe number of bytes to allocate
alignmentthe alignment of the allocated memory
Returns
void* pointer to the allocated memory

◆ deallocate()

virtual void from::DLKR::DLAllocator::deallocate ( void p)
pure virtual

Free previously allocated memory.

Parameters
ppointer to a block of previously allocated memory

◆ deallocate2()

virtual void from::DLKR::DLAllocator::deallocate2 ( void p)
inlinevirtual

Free previously allocated memory. Use the second allocator if it is bound, first if not.

Parameters
ppointer to a block of previously allocated memory.

◆ get_allocator_id()

virtual int from::DLKR::DLAllocator::get_allocator_id ( )
pure virtual

Unique allocator id sometimes used for comparing allocators.

Returns
int allocator identifier

◆ get_block()

virtual void * from::DLKR::DLAllocator::get_block ( void p)
pure virtual

Get the memory block that this memory belongs to.

Warning
May panic if this memory isn't owned by this allocator.
Parameters
ppointer to the memory block
Returns
void* pointer to the memory block base

◆ get_heap_allocation_count()

virtual size_t from::DLKR::DLAllocator::get_heap_allocation_count ( )
pure virtual

Total number of objects that have been allocated on the allocator's heap.

Returns
size_t allocated object count

◆ get_heap_backing_capacity()

virtual size_t from::DLKR::DLAllocator::get_heap_backing_capacity ( )
pure virtual

The remaining capacity of the backing heap.

Returns
size_t backing heap capacity

◆ get_heap_capacity()

virtual size_t from::DLKR::DLAllocator::get_heap_capacity ( )
pure virtual

The total capacity of the heap, in bytes.

Returns
size_t heap capacity

◆ get_heap_flags()

virtual int & from::DLKR::DLAllocator::get_heap_flags ( int flags)
pure virtual

Allocator and heap compatibility flags.

0x20 indicates thread safety (most commonly checked).

Returns
int& flags

◆ get_heap_size()

virtual size_t from::DLKR::DLAllocator::get_heap_size ( )
pure virtual

How many bytes out of the total capacity are allocated.

Returns
size_t heap size

◆ msize()

virtual size_t from::DLKR::DLAllocator::msize ( void p)
pure virtual

Check how big a given memory block is.

Parameters
ppointer to the memory block to check
Returns
size_t size of the memory block

◆ reallocate()

virtual void * from::DLKR::DLAllocator::reallocate ( void p,
size_t  cb 
)
pure virtual

Reallocate a memory block with a new size.

Note
Only valid for trivial types.
An alignment of at least 16 bytes is expected by ELDEN RING.
Parameters
ppointer to a block of previously allocated memory
cbthe number of bytes to allocate
Returns
void* pointer to the allocated memory

◆ reallocate2()

virtual void * from::DLKR::DLAllocator::reallocate2 ( void p,
size_t  cb 
)
inlinevirtual

Reallocate a memory block with a new size. Use the second allocator if it is bound, first if not.

Note
Only valid for trivial types.
An alignment of at least 16 bytes is expected by ELDEN RING.
Parameters
ppointer to a block of previously allocated memory
cbthe number of bytes to allocate
Returns
void* pointer to the allocated memory

◆ reallocate2_aligned()

virtual void * from::DLKR::DLAllocator::reallocate2_aligned ( void p,
size_t  cb,
size_t  alignment 
)
inlinevirtual

Reallocate an aligned memory block with a new size. Use the second allocator if it is bound, first if not.

Note
Only valid for trivial types.
An alignment of at least 16 bytes is expected by ELDEN RING.
Parameters
ppointer to a block of previously allocated memory
cbthe number of bytes to allocate
alignmentthe alignment of the allocated memory
Returns
void* pointer to the allocated memory

◆ reallocate_aligned()

virtual void * from::DLKR::DLAllocator::reallocate_aligned ( void p,
size_t  cb,
size_t  alignment 
)
pure virtual

Reallocate an aligned memory block with a new size.

Note
Only valid for trivial types.
An alignment of at least 16 bytes is expected by ELDEN RING.
Parameters
ppointer to a block of previously allocated memory
cbthe number of bytes to allocate
alignmentthe alignment of the allocated memory
Returns
void* pointer to the allocated memory

The documentation for this class was generated from the following file: