Block-Structured AMR Software Framework
amrex::CArena::Node Class Reference

The nodes in our free list and block list. More...

#include <AMReX_CArena.H>

Classes

struct  hash
 

Public Member Functions

 Node (void *a_block, void *a_owner, std::size_t a_size, MemStat *a_stat=nullptr) noexcept
 
bool operator< (const Node &rhs) const noexcept
 The "less-than" operator. More...
 
bool operator== (const Node &rhs) const noexcept
 The equality operator. More...
 
void * block () const noexcept
 The block address. More...
 
void block (void *blk) noexcept
 Set block address. More...
 
std::size_t size () const noexcept
 The size of the memory block. More...
 
void size (std::size_t sz) noexcept
 Set size. More...
 
void * owner () const noexcept
 
bool coalescable (const Node &rhs) const noexcept
 
MemStatmem_stat () const
 Get the MemStat object of the function where this block was allocated. More...
 
void mem_stat (MemStat *a_stat) noexcept
 Set MemStat. More...
 

Private Attributes

void * m_block
 The block of memory we reference. More...
 
void * m_owner
 The starting address of the original allocation. More...
 
std::size_t m_size
 The size of the block we represent. More...
 
MemStatm_stat
 Used for profiling if this Node represents a user allocated block of memory. More...
 

Detailed Description

The nodes in our free list and block list.

Constructor & Destructor Documentation

◆ Node()

amrex::CArena::Node::Node ( void *  a_block,
void *  a_owner,
std::size_t  a_size,
MemStat a_stat = nullptr 
)
inlinenoexcept

Member Function Documentation

◆ block() [1/2]

void* amrex::CArena::Node::block ( ) const
inlinenoexcept

The block address.

◆ block() [2/2]

void amrex::CArena::Node::block ( void *  blk)
inlinenoexcept

Set block address.

◆ coalescable()

bool amrex::CArena::Node::coalescable ( const Node rhs) const
inlinenoexcept

◆ mem_stat() [1/2]

MemStat* amrex::CArena::Node::mem_stat ( ) const
inline

Get the MemStat object of the function where this block was allocated.

◆ mem_stat() [2/2]

void amrex::CArena::Node::mem_stat ( MemStat a_stat)
inlinenoexcept

Set MemStat.

◆ operator<()

bool amrex::CArena::Node::operator< ( const Node rhs) const
inlinenoexcept

The "less-than" operator.

◆ operator==()

bool amrex::CArena::Node::operator== ( const Node rhs) const
inlinenoexcept

The equality operator.

◆ owner()

void* amrex::CArena::Node::owner ( ) const
inlinenoexcept

◆ size() [1/2]

std::size_t amrex::CArena::Node::size ( ) const
inlinenoexcept

The size of the memory block.

◆ size() [2/2]

void amrex::CArena::Node::size ( std::size_t  sz)
inlinenoexcept

Set size.

Member Data Documentation

◆ m_block

void* amrex::CArena::Node::m_block
private

The block of memory we reference.

◆ m_owner

void* amrex::CArena::Node::m_owner
private

The starting address of the original allocation.

◆ m_size

std::size_t amrex::CArena::Node::m_size
private

The size of the block we represent.

◆ m_stat

MemStat* amrex::CArena::Node::m_stat
private

Used for profiling if this Node represents a user allocated block of memory.


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