Flow123d  DF_patch_fe_data_tables-dc76198
Public Member Functions | List of all members
AssemblyArenaResource< Resource > Class Template Reference

#include <arena_resource.hh>

Inheritance diagram for AssemblyArenaResource< Resource >:
Inheritance graph
[legend]
Collaboration diagram for AssemblyArenaResource< Resource >:
Collaboration graph
[legend]

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...
 

Detailed Description

template<class Resource>
class AssemblyArenaResource< Resource >

Definition at line 140 of file arena_resource.hh.

Constructor & Destructor Documentation

◆ AssemblyArenaResource()

template<class Resource >
AssemblyArenaResource< Resource >::AssemblyArenaResource ( size_t  buffer_size,
size_t  simd_alignment,
std::pmr::memory_resource *  upstream = PatchArenaResource<Resource>::upstream_resource() 
)
inline

Constructor. Creates assembly arena.

Definition at line 143 of file arena_resource.hh.

◆ ~AssemblyArenaResource()

template<class Resource >
virtual AssemblyArenaResource< Resource >::~AssemblyArenaResource ( )
inlinevirtual

Definition at line 146 of file arena_resource.hh.

Member Function Documentation

◆ get_child_arena()

template<class Resource >
PatchArenaResource<Resource>* AssemblyArenaResource< Resource >::get_child_arena ( )
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.


The documentation for this class was generated from the following file: