|
KaMPIng 0.2.0
Flexible and (near) zero-overhead C++ bindings for MPI
|
STL-compatible allocator for requesting memory using the builtin MPI allocator. More...
#include <allocator.hpp>
Public Types | |
| using | value_type = T |
| The value type. | |
| using | propagate_on_container_move_assignment = std::true_type |
| the memory "ownership" can be moved when the container is move-assigned. If this would not be the case, container would need to free memory using the old allocator and reallocated it using the copied allocator. | |
| using | is_always_equal = std::true_type |
| memory allocated by one allocator instance can always be dellocated by another and vice-versa | |
Public Member Functions | |
| template<typename U > | |
| MPIAllocator (MPIAllocator< U > const &) noexcept | |
| Copy constructor for allocators with different value type. | |
| T * | allocate (size_t n) |
Allocates n * sizeof(T) bytes using MPI allocation functions. | |
| void | deallocate (T *p, size_t) |
Deallocates the storage referenced by the pointer p, which must be a pointer obtained by an earlier call to allocate(). | |
STL-compatible allocator for requesting memory using the builtin MPI allocator.
Note that this allocator may only be used after initializing MPI.
| T | The type to allocate. |
|
inlinenoexcept |
Copy constructor for allocators with different value type.
Since the allocator is stateless, we can also copy-assign allocators for other types (because this is a noop).
|
inline |
Allocates n * sizeof(T) bytes using MPI allocation functions.
| n | The number of objects to allocate storage for. |
|
inline |
Deallocates the storage referenced by the pointer p, which must be a pointer obtained by an earlier call to allocate().
| p | Pointer obtained from allocate(). |