24.02.1
|
Default malloc allocator implementation. More...
#include <AllocatorWrapper.h>
Public Member Functions | |
AllocatorWrapper (const AclAllocator &backing_allocator) noexcept | |
Default Constructor. More... | |
AllocatorWrapper (const AllocatorWrapper &) noexcept=default | |
AllocatorWrapper (AllocatorWrapper &&) noexcept=default | |
AllocatorWrapper & | operator= (const AllocatorWrapper &) noexcept=delete |
AllocatorWrapper & | operator= (AllocatorWrapper &&other) noexcept=default |
void * | alloc (size_t size) |
Allocate a chunk of memory of a given size in bytes. More... | |
void | free (void *ptr) |
Free an allocated memory block. More... | |
void * | aligned_alloc (size_t size, size_t alignment) |
Allocate a chunk of memory of a given size in bytes, while honoring a given alignment requirement. More... | |
void | aligned_free (void *ptr) |
Free an aligned memory block. More... | |
void | set_user_data (void *user_data) |
Set user data to be used by the allocator. More... | |
Default malloc allocator implementation.
Definition at line 32 of file AllocatorWrapper.h.
|
noexcept |
Default Constructor.
[in] | backing_allocator | Backing memory allocator to be used |
Definition at line 30 of file AllocatorWrapper.cpp.
|
defaultnoexcept |
|
defaultnoexcept |
void * aligned_alloc | ( | size_t | size, |
size_t | alignment | ||
) |
Allocate a chunk of memory of a given size in bytes, while honoring a given alignment requirement.
[in] | size | Size of memory to allocate in bytes |
[in] | alignment | Alignment requirements |
Definition at line 47 of file AllocatorWrapper.cpp.
References AclAllocator::aligned_alloc, ARM_COMPUTE_ERROR_ON, and AclAllocator::user_data.
void aligned_free | ( | void * | ptr | ) |
Free an aligned memory block.
[in] | ptr | Pointer to the memory to release |
Definition at line 53 of file AllocatorWrapper.cpp.
References AclAllocator::aligned_free, ARM_COMPUTE_ERROR_ON, and AclAllocator::user_data.
void * alloc | ( | size_t | size | ) |
Allocate a chunk of memory of a given size in bytes.
[in] | size | Size of memory to allocate in bytes |
Definition at line 35 of file AllocatorWrapper.cpp.
References AclAllocator::alloc, ARM_COMPUTE_ERROR_ON, and AclAllocator::user_data.
void free | ( | void * | ptr | ) |
Free an allocated memory block.
[in] | ptr | Pointer to allocated memory |
Definition at line 41 of file AllocatorWrapper.cpp.
References ARM_COMPUTE_ERROR_ON, AclAllocator::free, and AclAllocator::user_data.
|
defaultnoexcept |
|
deletenoexcept |
void set_user_data | ( | void * | user_data | ) |
Set user data to be used by the allocator.
[in] | user_data | User data to be used by the allocator |
Definition at line 59 of file AllocatorWrapper.cpp.
References AclAllocator::user_data.