BioDynaMo  v1.05.119-a4ff3934
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
bdm::memory_manager_detail::NumaPoolAllocator Class Reference

Pool allocator for a specific allocation size and numa node.
. More...

#include <memory_manager.h>

Collaboration diagram for bdm::memory_manager_detail::NumaPoolAllocator:
[legend]

Public Member Functions

 NumaPoolAllocator (uint64_t size, int nid, uint64_t size_n_pages, real_t growth_rate, uint64_t max_mem_per_thread_factor)
 
 ~NumaPoolAllocator ()
 
void * New (int tid)
 
void Delete (void *p)
 
uint64_t GetSize () const
 

Static Public Member Functions

static uint64_t RoundUpTo (uint64_t number, uint64_t multiple)
 

Private Member Functions

void AllocNewMemoryBlock (std::size_t size)
 
void InitializeNPages (List *tl_list, char *block, uint64_t mem_block_size)
 

Private Attributes

uint64_t size_n_pages_
 
real_t growth_rate_
 
uint64_t max_nodes_per_thread_
 
uint64_t num_elements_per_n_pages_
 
uint64_t total_size_ = 0
 
uint64_t size_
 
int nid_
 
ThreadInfotinfo_
 
std::vector< AllocatedBlockmemory_blocks_
 
std::vector< Listfree_lists_
 
List central_
 
Spinlock lock_
 

Static Private Attributes

static constexpr uint64_t kMetadataSize = 8
 

Detailed Description

Pool allocator for a specific allocation size and numa node.
.

Definition at line 94 of file memory_manager.h.

Constructor & Destructor Documentation

◆ NumaPoolAllocator()

bdm::memory_manager_detail::NumaPoolAllocator::NumaPoolAllocator ( uint64_t  size,
int  nid,
uint64_t  size_n_pages,
real_t  growth_rate,
uint64_t  max_mem_per_thread_factor 
)

Definition at line 151 of file memory_manager.cc.

◆ ~NumaPoolAllocator()

bdm::memory_manager_detail::NumaPoolAllocator::~NumaPoolAllocator ( )

Definition at line 169 of file memory_manager.cc.

Member Function Documentation

◆ AllocNewMemoryBlock()

void bdm::memory_manager_detail::NumaPoolAllocator::AllocNewMemoryBlock ( std::size_t  size)
private

Definition at line 235 of file memory_manager.cc.

◆ Delete()

void bdm::memory_manager_detail::NumaPoolAllocator::Delete ( void *  p)

Definition at line 218 of file memory_manager.cc.

◆ GetSize()

uint64_t bdm::memory_manager_detail::NumaPoolAllocator::GetSize ( ) const

Definition at line 233 of file memory_manager.cc.

◆ InitializeNPages()

void bdm::memory_manager_detail::NumaPoolAllocator::InitializeNPages ( List tl_list,
char *  block,
uint64_t  mem_block_size 
)
private

Definition at line 252 of file memory_manager.cc.

◆ New()

void * bdm::memory_manager_detail::NumaPoolAllocator::New ( int  tid)

Definition at line 176 of file memory_manager.cc.

◆ RoundUpTo()

uint64_t bdm::memory_manager_detail::NumaPoolAllocator::RoundUpTo ( uint64_t  number,
uint64_t  multiple 
)
static

Definition at line 289 of file memory_manager.cc.

Member Data Documentation

◆ central_

List bdm::memory_manager_detail::NumaPoolAllocator::central_
private

Definition at line 121 of file memory_manager.h.

◆ free_lists_

std::vector<List> bdm::memory_manager_detail::NumaPoolAllocator::free_lists_
private

Definition at line 120 of file memory_manager.h.

◆ growth_rate_

real_t bdm::memory_manager_detail::NumaPoolAllocator::growth_rate_
private

Definition at line 112 of file memory_manager.h.

◆ kMetadataSize

constexpr uint64_t bdm::memory_manager_detail::NumaPoolAllocator::kMetadataSize = 8
staticconstexprprivate

Definition at line 110 of file memory_manager.h.

◆ lock_

Spinlock bdm::memory_manager_detail::NumaPoolAllocator::lock_
private

Definition at line 122 of file memory_manager.h.

◆ max_nodes_per_thread_

uint64_t bdm::memory_manager_detail::NumaPoolAllocator::max_nodes_per_thread_
private

Definition at line 113 of file memory_manager.h.

◆ memory_blocks_

std::vector<AllocatedBlock> bdm::memory_manager_detail::NumaPoolAllocator::memory_blocks_
private

Definition at line 119 of file memory_manager.h.

◆ nid_

int bdm::memory_manager_detail::NumaPoolAllocator::nid_
private

Definition at line 117 of file memory_manager.h.

◆ num_elements_per_n_pages_

uint64_t bdm::memory_manager_detail::NumaPoolAllocator::num_elements_per_n_pages_
private

Definition at line 114 of file memory_manager.h.

◆ size_

uint64_t bdm::memory_manager_detail::NumaPoolAllocator::size_
private

Definition at line 116 of file memory_manager.h.

◆ size_n_pages_

uint64_t bdm::memory_manager_detail::NumaPoolAllocator::size_n_pages_
private

Definition at line 111 of file memory_manager.h.

◆ tinfo_

ThreadInfo* bdm::memory_manager_detail::NumaPoolAllocator::tinfo_
private

Definition at line 118 of file memory_manager.h.

◆ total_size_

uint64_t bdm::memory_manager_detail::NumaPoolAllocator::total_size_ = 0
private

Definition at line 115 of file memory_manager.h.


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