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

#include <memory_manager.h>

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

Public Member Functions

 List (uint64_t n)
 
 List (const List &other)
 
NodePopFront ()
 
void PushFront (Node *head)
 
void PushFrontThreadSafe (Node *head)
 
void PushBackN (Node *head, Node *tail)
 
void PushBackNThreadSafe (Node *head, Node *tail)
 
void PopBackN (Node **head, Node **tail)
 
void PopBackNThreadSafe (Node **head, Node **tail)
 
bool Empty () const
 
bool CanPopBackN () const
 
uint64_t Size () const
 
uint64_t GetN () const
 

Private Attributes

Nodehead_ = nullptr
 
Nodetail_ = nullptr
 
std::list< Node * > skip_list_
 
uint64_t size_ = 0
 
uint64_t nodes_before_skip_list_ = 0
 
uint64_t n_
 Number of nodes for which fast migrations are supported. More...
 
Spinlock lock_
 

Detailed Description

List to store free memory regions.
Supports fast migration of N nodes to and from the list.
N has to be set when the object is constructed.
Fast migration is supported by maintaining a skip list.

Definition at line 40 of file memory_manager.h.

Constructor & Destructor Documentation

◆ List() [1/2]

bdm::memory_manager_detail::List::List ( uint64_t  n)
explicit
Parameters
nn is the number of elements that can be added and removed very fast.

Definition at line 28 of file memory_manager.cc.

◆ List() [2/2]

bdm::memory_manager_detail::List::List ( const List other)

Definition at line 30 of file memory_manager.cc.

Member Function Documentation

◆ CanPopBackN()

bool bdm::memory_manager_detail::List::CanPopBackN ( ) const

Definition at line 129 of file memory_manager.cc.

◆ Empty()

bool bdm::memory_manager_detail::List::Empty ( ) const

Definition at line 127 of file memory_manager.cc.

◆ GetN()

uint64_t bdm::memory_manager_detail::List::GetN ( ) const

Definition at line 133 of file memory_manager.cc.

◆ PopBackN()

void bdm::memory_manager_detail::List::PopBackN ( Node **  head,
Node **  tail 
)

Definition at line 106 of file memory_manager.cc.

◆ PopBackNThreadSafe()

void bdm::memory_manager_detail::List::PopBackNThreadSafe ( Node **  head,
Node **  tail 
)

Definition at line 122 of file memory_manager.cc.

◆ PopFront()

Node * bdm::memory_manager_detail::List::PopFront ( )

Definition at line 38 of file memory_manager.cc.

◆ PushBackN()

void bdm::memory_manager_detail::List::PushBackN ( Node head,
Node tail 
)

Definition at line 83 of file memory_manager.cc.

◆ PushBackNThreadSafe()

void bdm::memory_manager_detail::List::PushBackNThreadSafe ( Node head,
Node tail 
)

Definition at line 101 of file memory_manager.cc.

◆ PushFront()

void bdm::memory_manager_detail::List::PushFront ( Node head)

Definition at line 60 of file memory_manager.cc.

◆ PushFrontThreadSafe()

void bdm::memory_manager_detail::List::PushFrontThreadSafe ( Node head)

Definition at line 78 of file memory_manager.cc.

◆ Size()

uint64_t bdm::memory_manager_detail::List::Size ( ) const

Definition at line 131 of file memory_manager.cc.

Member Data Documentation

◆ head_

Node* bdm::memory_manager_detail::List::head_ = nullptr
private

Definition at line 71 of file memory_manager.h.

◆ lock_

Spinlock bdm::memory_manager_detail::List::lock_
private

Definition at line 78 of file memory_manager.h.

◆ n_

uint64_t bdm::memory_manager_detail::List::n_
private

Number of nodes for which fast migrations are supported.

Definition at line 77 of file memory_manager.h.

◆ nodes_before_skip_list_

uint64_t bdm::memory_manager_detail::List::nodes_before_skip_list_ = 0
private

Definition at line 75 of file memory_manager.h.

◆ size_

uint64_t bdm::memory_manager_detail::List::size_ = 0
private

Definition at line 74 of file memory_manager.h.

◆ skip_list_

std::list<Node*> bdm::memory_manager_detail::List::skip_list_
private

Definition at line 73 of file memory_manager.h.

◆ tail_

Node* bdm::memory_manager_detail::List::tail_ = nullptr
private

Definition at line 72 of file memory_manager.h.


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