|
TRIQS/nda 2.0.0
Multi-dimensional array library for C++
|
#include <nda/mem/allocators.hpp>
Custom allocator that uses nda::mem::malloc to allocate memory.
| AdrSp | nda::mem::AddressSpace in which the memory is allocated. |
Definition at line 60 of file allocators.hpp.
Public Member Functions | |
| mallocator ()=default | |
| Default constructor. | |
| mallocator (mallocator &&)=default | |
| Default move constructor. | |
| mallocator (mallocator const &)=delete | |
| Deleted copy constructor. | |
| mallocator & | operator= (mallocator &&)=default |
| Default move assignment operator. | |
| mallocator & | operator= (mallocator const &)=delete |
| Deleted copy assignment operator. | |
Static Public Member Functions | |
| static blk_t | allocate (size_t s) noexcept |
| Allocate memory using nda::mem::malloc. | |
| static blk_t | allocate_zero (size_t s) noexcept |
| Allocate memory and set it to zero. | |
| static void | deallocate (blk_t b) noexcept |
| Deallocate memory using nda::mem::free. | |
Static Public Attributes | |
| static constexpr auto | address_space = AdrSp |
| nda::mem::AddressSpace in which the memory is allocated. | |
|
inlinestaticnoexcept |
Allocate memory using nda::mem::malloc.
| s | Size in bytes of the memory to allocate. |
Definition at line 86 of file allocators.hpp.
|
inlinestaticnoexcept |
Allocate memory and set it to zero.
The behavior depends on the address space:
| s | Size in bytes of the memory to allocate. |
Definition at line 98 of file allocators.hpp.
|
inlinestaticnoexcept |
Deallocate memory using nda::mem::free.
| b | nda::mem::blk_t memory block to deallocate. |
Definition at line 112 of file allocators.hpp.