Default malloc allocator implementation.
More...
#include <AllocatorWrapper.h>
Default malloc allocator implementation.
Definition at line 32 of file AllocatorWrapper.h.
◆ AllocatorWrapper() [1/3]
Default Constructor.
- Parameters
-
[in] | backing_allocator | Backing memory allocator to be used |
Definition at line 29 of file AllocatorWrapper.cpp.
30 : _backing_allocator(backing_allocator)
◆ AllocatorWrapper() [2/3]
◆ AllocatorWrapper() [3/3]
◆ aligned_alloc()
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.
- Parameters
-
[in] | size | Size of memory to allocate in bytes |
[in] | alignment | Alignment requirements |
- Returns
- A pointer to the allocated memory if successful else nullptr
Definition at line 46 of file AllocatorWrapper.cpp.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
void *(* aligned_alloc)(void *user_data, size_t size, size_t alignment)
Allocate a block of size bytes of memory.
References AclAllocator::aligned_alloc, ARM_COMPUTE_ERROR_ON, and AclAllocator::user_data.
◆ aligned_free()
void aligned_free |
( |
void * |
ptr | ) |
|
◆ alloc()
void * alloc |
( |
size_t |
size | ) |
|
Allocate a chunk of memory of a given size in bytes.
- Parameters
-
[in] | size | Size of memory to allocate in bytes |
- Returns
- A pointer to the allocated memory if successful else nullptr
Definition at line 34 of file AllocatorWrapper.cpp.
37 return _backing_allocator.
alloc(_backing_allocator.
user_data, size);
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
void *(* alloc)(void *user_data, size_t size)
Allocate a block of size bytes of memory.
References AclAllocator::alloc, ARM_COMPUTE_ERROR_ON, and AclAllocator::user_data.
◆ free()
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ set_user_data()
void set_user_data |
( |
void * |
user_data | ) |
|
The documentation for this class was generated from the following files: