libER 0.1.4.2
ELDEN RING API library
|
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 int & | get_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 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 | _unk0x70 () |
Unknown method, isn't supported by any class that implements DLKR::DLAllocator. | |
virtual void * | allocate2 (size_t cb) |
Allocate a block of at least this many bytes. Use the second allocator if it is bound, first if not. | |
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 is bound, first if not. | |
virtual void * | reallocate2 (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 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, 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 void * | get_block (void *p)=0 |
Get the memory block 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).
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 |
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 |
|
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.
cb | the number of bytes to allocate |
alignment | the alignment of the allocated memory |
|
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 |
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. |
Unique allocator id sometimes used for comparing allocators.
Get the memory block 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 remaining capacity of the backing heap.
The total capacity of the heap, in bytes.
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 |
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 |
|
inlinevirtual |
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 |
|
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 |