libER 0.1.4.2
ELDEN RING API library
|
Common ELDEN RING allocator interface. More...
#include <from_allocator.hpp>
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 void * | allocate (size_t cb)=0 |
Allocate a block of at least this many bytes. | |
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 * | reallocate (void *p, size_t cb)=0 |
Reallocate a memory block with a new size. | |
virtual void * | reallocate_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 void * | allocate_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 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 is bound, first if not. | |
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, first if not. | |
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, 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 void * | get_memory_block (void *p)=0 |
Get the memory block base that this memory belongs to. | |
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).
Unique allocator id sometimes used for comparing allocators.
Unknown function which is defined in the interface, never overriden or used.
Allocate a block of at least this many bytes.
cb | the number of bytes to allocate |
|
pure virtual |
Allocate a block of at least this many bytes with a given alignment.
cb | the number of bytes to allocate |
alignment | the alignment of the allocated memory |
Allocate a block of at least this many bytes. Use the second allocator if it is bound, first if not.
cb | the number of bytes to allocate |
|
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.
cb | the number of bytes to allocate |
alignment | the alignment of the allocated memory |
The remaining capacity of the backing heap.
Does memory block belong to the first bound allocator?
Does memory block belong to the second bound allocator?
Free previously allocated memory.
p | pointer to a block of previously allocated memory. |
Free previously allocated memory. Use the second allocator if it is bound, first if not.
p | pointer to a block of previously allocated memory. |
Get the memory block base that this memory belongs to.
p | pointer to the memory block |
Total number of objects that have been allocated on the allocator's heap.
The total capacity of the heap, in bytes.
|
pure virtual |
Allocator and heap compatibility flags.
0x20 indicates thread safety (most commonly checked).
How many bytes out of the total capacity are allocated.
Check how big a given memory block is.
p | pointer to the memory block to check |
Reallocate a memory block with a new size.
p | pointer to a block of previously allocated memory |
cb | the number of bytes to allocate |
|
pure virtual |
Reallocate an aligned memory block with a new size.
p | pointer to a block of previously allocated memory |
cb | the number of bytes to allocate |
alignment | the alignment of the allocated memory |
Reallocate a memory block with a new size. Use the second allocator if it is bound, first if not.
p | pointer to a block of previously allocated memory |
cb | the number of bytes to allocate |
|
pure virtual |
Reallocate an aligned memory block with a new size. Use the second allocator if it is bound, first if not.
p | pointer to a block of previously allocated memory |
cb | the number of bytes to allocate |
alignment | the alignment of the allocated memory |