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>

Inheritance diagram for from::DLKR::DLAllocator:
from::DLKR::DLBackAllocator

Public Member Functions

virtual int _allocator_id ()=0
 Unique allocator id sometimes used for comparing allocators.
 
virtual int _unused ()
 Unknown function which is defined in the interface, never overriden or used.
 
virtual std::bitset< 8 > heap_flags ()=0
 Allocator and heap compatibility flags.
 
virtual size_t heap_capacity ()=0
 The total capacity of the heap, in bytes.
 
virtual size_t heap_size ()=0
 How many bytes out of the total capacity are allocated.
 
virtual size_t backing_heap_capacity ()=0
 The remaining capacity of the backing heap.
 
virtual size_t 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 _unsupported ()
 Unknown method, isn't supported by any class that implements DLKR::DLAllocator.
 
virtual voidallocate_second (size_t cb)=0
 Allocate a block of at least this many bytes. Use the second allocator if it is bound, first if not.
 
virtual voidallocate_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 is bound, first if not.
 
virtual voidreallocate_second (void *p, size_t cb)=0
 Reallocate a memory block with a new size. Use the second allocator if it is bound, first if not.
 
virtual voidreallocate_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, first if not.
 
virtual void deallocate_second (void *p)=0
 Free previously allocated memory. Use the second allocator if it is bound, first if not.
 
virtual bool _unknown_bool ()
 Unknown method, seemingly unused.
 
virtual bool belongs_to_first (void *p)=0
 Does memory block belong to the first bound allocator?
 
virtual bool belongs_to_second (void *p)=0
 Does memory block belong to the second bound allocator?
 
virtual void lock ()
 Lock the allocator's mutex (if present and accessible).
 
virtual void unlock ()
 Unlock the allocator's mutex (if present and accessible).
 
virtual voidget_memory_block (void *p)=0
 Get the memory block base 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

◆ _allocator_id()

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

Unique allocator id sometimes used for comparing allocators.

Returns
int allocator identifier

◆ _unused()

virtual int from::DLKR::DLAllocator::_unused ( )
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

◆ 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

◆ allocate_second()

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

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

◆ allocate_second_aligned()

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

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

◆ backing_heap_capacity()

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

The remaining capacity of the backing heap.

Returns
size_t backing heap capacity

◆ belongs_to_first()

virtual bool from::DLKR::DLAllocator::belongs_to_first ( void p)
pure virtual

Does memory block belong to the first bound allocator?

Note
Seems unused.

◆ belongs_to_second()

virtual bool from::DLKR::DLAllocator::belongs_to_second ( void p)
pure virtual

Does memory block belong to the second bound allocator?

Note
Seems unused.

◆ deallocate()

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

Free previously allocated memory.

Parameters
ppointer to a block of previously allocated memory.

◆ deallocate_second()

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

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_memory_block()

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

Get the memory block base 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

◆ heap_allocation_count()

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

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

Returns
size_t allocated object count

◆ heap_capacity()

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

The total capacity of the heap, in bytes.

Returns
size_t heap capacity

◆ heap_flags()

virtual std::bitset< 8 > from::DLKR::DLAllocator::heap_flags ( )
pure virtual

Allocator and heap compatibility flags.

0x20 indicates thread safety (most commonly checked).

Returns
std::bitset<8> flags

◆ heap_size()

virtual size_t from::DLKR::DLAllocator::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

◆ 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

◆ reallocate_second()

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

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

◆ reallocate_second_aligned()

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

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

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