Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
amrex::DataAllocator Struct Reference

Lightweight allocator/deallocator backed by an Arena. More...

#include <AMReX_DataAllocator.H>

Inheritance diagram for amrex::DataAllocator:
amrex::BaseFab< EBCellFlag > amrex::BaseFab< Real > amrex::BaseFab< int > amrex::BaseFab< char > amrex::BaseFab< GpuComplex< Real > > amrex::BaseFab< GpuComplex< typename MF::value_type > > amrex::BaseFab< GpuComplex< T > > amrex::BaseFab< HYPRE_Int > amrex::BaseFab< AtomicInt > amrex::BaseFab< PetscInt > amrex::BaseFab< T > amrex::TableData< T, N, ORDER >

Public Member Functions

 DataAllocator () noexcept=default
 Default-construct; alloc/free will use The_Arena().
 
 DataAllocator (Arena *ar) noexcept
 Construct with an explicit arena ar.
 
void * alloc (std::size_t sz) const noexcept
 Allocate sz bytes from the arena.
 
void free (void *pt) const noexcept
 Return the allocation at pt to the arena.
 
Arenaarena () const noexcept
 Return the stored arena, or The_Arena() if none was set.
 

Public Attributes

Arenam_arena = nullptr
 Stored arena pointer (may be null).
 

Detailed Description

Lightweight allocator/deallocator backed by an Arena.

Falls back to The_Arena() when no arena is supplied.

Constructor & Destructor Documentation

◆ DataAllocator() [1/2]

amrex::DataAllocator::DataAllocator ( )
defaultnoexcept

Default-construct; alloc/free will use The_Arena().

◆ DataAllocator() [2/2]

amrex::DataAllocator::DataAllocator ( Arena ar)
inlinenoexcept

Construct with an explicit arena ar.

Member Function Documentation

◆ alloc()

void * amrex::DataAllocator::alloc ( std::size_t  sz) const
inlinenoexcept

Allocate sz bytes from the arena.

◆ arena()

Arena * amrex::DataAllocator::arena ( ) const
inlinenoexcept

Return the stored arena, or The_Arena() if none was set.

◆ free()

void amrex::DataAllocator::free ( void *  pt) const
inlinenoexcept

Return the allocation at pt to the arena.

Member Data Documentation

◆ m_arena

Arena* amrex::DataAllocator::m_arena = nullptr

Stored arena pointer (may be null).


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