Realm
A distributed, event-based tasking library
Loading...
Searching...
No Matches
Realm::BasicRangeAllocator< RT, TT > Class Template Reference

#include <mem_impl.h>

Inheritance diagram for Realm::BasicRangeAllocator< RT, TT >:

Classes

struct  MemoryStats
 
struct  Range
 

Public Member Functions

 BasicRangeAllocator (void)
 
 ~BasicRangeAllocator (void)
 
 BasicRangeAllocator (const BasicRangeAllocator &)=default
 
BasicRangeAllocatoroperator= (const BasicRangeAllocator &)=default
 
 BasicRangeAllocator (BasicRangeAllocator &&) noexcept=default
 
BasicRangeAllocatoroperator= (BasicRangeAllocator &&) noexcept=default
 
void swap (BasicRangeAllocator< RT, TT > &swap_with)
 
void add_range (RT first, RT last)
 
bool can_allocate (TT tag, RT size, RT alignment)
 
bool allocate (TT tag, RT size, RT alignment, RT &first)
 
void deallocate (TT tag, bool missing_ok=false)
 
bool lookup (TT tag, RT &first, RT &size)
 
size_t split_range (TT old_tag, const std::vector< TT > &new_tags, const std::vector< RT > &sizes, const std::vector< RT > &alignment, std::vector< RT > &allocs_first, bool missing_ok=false)
 
MemoryStats get_allocator_stats ()
 
bool free_list_has_cycle ()
 
bool has_invalid_ranges ()
 

Public Attributes

std::map< TT, unsigned > allocated
 
std::vector< Rangeranges
 

Static Public Attributes

static const unsigned SENTINEL = 0
 

Protected Member Functions

unsigned alloc_range (RT first, RT last)
 
void deallocate (unsigned del_idx)
 
void free_range (unsigned index)
 

Protected Attributes

unsigned first_free_range
 

Constructor & Destructor Documentation

◆ BasicRangeAllocator() [1/3]

template<typename RT , typename TT >
Realm::BasicRangeAllocator< RT, TT >::BasicRangeAllocator ( void  )

◆ ~BasicRangeAllocator()

template<typename RT , typename TT >
Realm::BasicRangeAllocator< RT, TT >::~BasicRangeAllocator ( void  )

◆ BasicRangeAllocator() [2/3]

template<typename RT , typename TT >
Realm::BasicRangeAllocator< RT, TT >::BasicRangeAllocator ( const BasicRangeAllocator< RT, TT > &  )
default

◆ BasicRangeAllocator() [3/3]

template<typename RT , typename TT >
Realm::BasicRangeAllocator< RT, TT >::BasicRangeAllocator ( BasicRangeAllocator< RT, TT > &&  )
defaultnoexcept

Member Function Documentation

◆ add_range()

template<typename RT , typename TT >
void Realm::BasicRangeAllocator< RT, TT >::add_range ( RT  first,
RT  last 
)

◆ alloc_range()

template<typename RT , typename TT >
unsigned Realm::BasicRangeAllocator< RT, TT >::alloc_range ( RT  first,
RT  last 
)
protected

◆ allocate()

template<typename RT , typename TT >
bool Realm::BasicRangeAllocator< RT, TT >::allocate ( TT  tag,
RT  size,
RT  alignment,
RT &  first 
)

◆ can_allocate()

template<typename RT , typename TT >
bool Realm::BasicRangeAllocator< RT, TT >::can_allocate ( TT  tag,
RT  size,
RT  alignment 
)

◆ deallocate() [1/2]

template<typename RT , typename TT >
void Realm::BasicRangeAllocator< RT, TT >::deallocate ( TT  tag,
bool  missing_ok = false 
)

◆ deallocate() [2/2]

template<typename RT , typename TT >
void Realm::BasicRangeAllocator< RT, TT >::deallocate ( unsigned  del_idx)
protected

◆ free_list_has_cycle()

template<typename RT , typename TT >
bool Realm::BasicRangeAllocator< RT, TT >::free_list_has_cycle ( )

◆ free_range()

template<typename RT , typename TT >
void Realm::BasicRangeAllocator< RT, TT >::free_range ( unsigned  index)
protected

◆ get_allocator_stats()

template<typename RT , typename TT >
MemoryStats Realm::BasicRangeAllocator< RT, TT >::get_allocator_stats ( )

◆ has_invalid_ranges()

template<typename RT , typename TT >
bool Realm::BasicRangeAllocator< RT, TT >::has_invalid_ranges ( )

◆ lookup()

template<typename RT , typename TT >
bool Realm::BasicRangeAllocator< RT, TT >::lookup ( TT  tag,
RT &  first,
RT &  size 
)

◆ operator=() [1/2]

template<typename RT , typename TT >
BasicRangeAllocator & Realm::BasicRangeAllocator< RT, TT >::operator= ( BasicRangeAllocator< RT, TT > &&  )
defaultnoexcept

◆ operator=() [2/2]

template<typename RT , typename TT >
BasicRangeAllocator & Realm::BasicRangeAllocator< RT, TT >::operator= ( const BasicRangeAllocator< RT, TT > &  )
default

◆ split_range()

template<typename RT , typename TT >
size_t Realm::BasicRangeAllocator< RT, TT >::split_range ( TT  old_tag,
const std::vector< TT > &  new_tags,
const std::vector< RT > &  sizes,
const std::vector< RT > &  alignment,
std::vector< RT > &  allocs_first,
bool  missing_ok = false 
)

◆ swap()

template<typename RT , typename TT >
void Realm::BasicRangeAllocator< RT, TT >::swap ( BasicRangeAllocator< RT, TT > &  swap_with)

Member Data Documentation

◆ allocated

template<typename RT , typename TT >
std::map<TT, unsigned> Realm::BasicRangeAllocator< RT, TT >::allocated

◆ first_free_range

template<typename RT , typename TT >
unsigned Realm::BasicRangeAllocator< RT, TT >::first_free_range
protected

◆ ranges

template<typename RT , typename TT >
std::vector<Range> Realm::BasicRangeAllocator< RT, TT >::ranges

◆ SENTINEL

template<typename RT , typename TT >
const unsigned Realm::BasicRangeAllocator< RT, TT >::SENTINEL = 0
static

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