Flow123d
DF_patch_fe_mechanics-a6ba684
|
#include <arena_resource.hh>
Public Member Functions | |
AssemblyArenaResource (size_t buffer_size, size_t simd_alignment, std::pmr::memory_resource *upstream=PatchArenaResource< Resource >::upstream_resource()) | |
Constructor. Creates assembly arena. More... | |
virtual | ~AssemblyArenaResource () |
PatchArenaResource< Resource > * | get_child_arena () |
Public Member Functions inherited from PatchArenaResource< Resource > | |
DECLARE_EXCEPTION (ExcArenaAllocation,<< "Allocation of ArenaResource failed. Please check if correct type of upstream is used.") | |
PatchArenaResource (void *buffer, size_t buffer_size, size_t simd_alignment, std::pmr::memory_resource *upstream=PatchArenaResource< Resource >::upstream_resource()) | |
Same as previous but doesn't construct buffer implicitly. More... | |
~PatchArenaResource ()=default | |
void | print_space () |
Compute and print free space and used space of arena buffer. Development method. More... | |
Resource & | resource () |
Getter for resource. More... | |
template<class T > | |
T * | allocate_8 (size_t n_items) |
Allocate and return data pointer of n_item array of type T (alignment to length 8 bytes) More... | |
template<class T > | |
T * | allocate_simd (size_t n_items) |
Allocate and return data pointer of n_item array of type T (alignment to length given by simd_alignment constructor argument) More... | |
void | reset () |
Additional Inherited Members | |
Protected Member Functions inherited from PatchArenaResource< Resource > | |
void * | raw_allocate (size_t bytes, size_t alignment) |
void * | do_allocate (size_t bytes, size_t alignment) override |
Override do_allocate to handle allocation logic. More... | |
void | do_deallocate (void *p, size_t bytes, size_t alignment) override |
Override do_deallocate (no-op for monotonic buffer) More... | |
bool | do_is_equal (const std::pmr::memory_resource &other) const noexcept override |
Override do_is_equal for memory resource comparison. More... | |
Static Protected Member Functions inherited from PatchArenaResource< Resource > | |
static std::pmr::memory_resource * | upstream_resource () |
Returns different upstream resource in debug / release mode. More... | |
Protected Attributes inherited from PatchArenaResource< Resource > | |
std::pmr::memory_resource * | upstream_ |
Pointer to upstream. More... | |
void * | buffer_ |
Pointer to buffer. More... | |
size_t | buffer_size_ |
Size of buffer. More... | |
Resource | resource_ |
Resource of arena. More... | |
size_t | simd_alignment_ |
Size of SIMD alignment. More... | |
bool | full_data_ |
Flag signs full data (child arena is created) More... | |
Definition at line 140 of file arena_resource.hh.
|
inline |
Constructor. Creates assembly arena.
Definition at line 143 of file arena_resource.hh.
|
inlinevirtual |
Definition at line 146 of file arena_resource.hh.
|
inline |
Create and return child arena.
Child arena is created in free space of actual arena. Actual arena is marked as full (flag full_data_) and cannot allocate new data.
Definition at line 156 of file arena_resource.hh.