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

#include <mem_impl.h>

Inheritance diagram for Realm::SizedRangeAllocator< RT, TT, SORTED >:
[legend]
Collaboration diagram for Realm::SizedRangeAllocator< RT, TT, SORTED >:
[legend]

Public Types

using Range = typename BasicRangeAllocator<RT, TT>::Range

Public Member Functions

 SizedRangeAllocator (void)
 ~SizedRangeAllocator (void)
 SizedRangeAllocator (const SizedRangeAllocator &)=default
SizedRangeAllocator & operator= (const SizedRangeAllocator &)=default
 SizedRangeAllocator (SizedRangeAllocator &&) noexcept=default
SizedRangeAllocator & operator= (SizedRangeAllocator &&) noexcept=default
void swap (SizedRangeAllocator< RT, TT, SORTED > &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)
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)
void add_to_free_list (unsigned index, Range &range)
void remove_from_free_list (unsigned index, Range &range)
void grow_hole (unsigned index, Range &range, RT bound, bool before)
BasicRangeAllocator< RT, TT >::MemoryStats get_allocator_stats ()
Public Member Functions inherited from Realm::BasicRangeAllocator< RT, TT >
 BasicRangeAllocator (void)
 ~BasicRangeAllocator (void)
 BasicRangeAllocator (const BasicRangeAllocator &)=default
BasicRangeAllocator & operator= (const BasicRangeAllocator &)=default
 BasicRangeAllocator (BasicRangeAllocator &&) noexcept=default
BasicRangeAllocator & operator= (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 ()

Static Public Member Functions

static unsigned floor_log2 (uint64_t size)

Static Public Attributes

static constexpr unsigned SENTINEL = BasicRangeAllocator<RT, TT>::SENTINEL
Static Public Attributes inherited from Realm::BasicRangeAllocator< RT, TT >
static const unsigned SENTINEL = 0

Protected Attributes

std::vector< unsigned > size_based_free_lists
Protected Attributes inherited from Realm::BasicRangeAllocator< RT, TT >
unsigned first_free_range

Additional Inherited Members

Public Attributes inherited from Realm::BasicRangeAllocator< RT, TT >
std::map< TT, unsigned > allocated
std::vector< Range > ranges
Protected Member Functions inherited from Realm::BasicRangeAllocator< RT, TT >
unsigned alloc_range (RT first, RT last)
void deallocate (unsigned del_idx)
void free_range (unsigned index)

Member Typedef Documentation

◆ Range

template<typename RT, typename TT, bool SORTED>
using Realm::SizedRangeAllocator< RT, TT, SORTED >::Range = typename BasicRangeAllocator<RT, TT>::Range

Constructor & Destructor Documentation

◆ SizedRangeAllocator() [1/3]

template<typename RT, typename TT, bool SORTED>
Realm::SizedRangeAllocator< RT, TT, SORTED >::SizedRangeAllocator ( void )

◆ ~SizedRangeAllocator()

template<typename RT, typename TT, bool SORTED>
Realm::SizedRangeAllocator< RT, TT, SORTED >::~SizedRangeAllocator ( void )

◆ SizedRangeAllocator() [2/3]

template<typename RT, typename TT, bool SORTED>
Realm::SizedRangeAllocator< RT, TT, SORTED >::SizedRangeAllocator ( const SizedRangeAllocator< RT, TT, SORTED > & )
default

◆ SizedRangeAllocator() [3/3]

template<typename RT, typename TT, bool SORTED>
Realm::SizedRangeAllocator< RT, TT, SORTED >::SizedRangeAllocator ( SizedRangeAllocator< RT, TT, SORTED > && )
defaultnoexcept

Member Function Documentation

◆ add_range()

template<typename RT, typename TT, bool SORTED>
void Realm::SizedRangeAllocator< RT, TT, SORTED >::add_range ( RT first,
RT last )

◆ add_to_free_list()

template<typename RT, typename TT, bool SORTED>
void Realm::SizedRangeAllocator< RT, TT, SORTED >::add_to_free_list ( unsigned index,
Range & range )

◆ allocate()

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

◆ can_allocate()

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

◆ deallocate()

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

◆ floor_log2()

template<typename RT, typename TT, bool SORTED>
unsigned Realm::SizedRangeAllocator< RT, TT, SORTED >::floor_log2 ( uint64_t size)
static

◆ get_allocator_stats()

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

◆ grow_hole()

template<typename RT, typename TT, bool SORTED>
void Realm::SizedRangeAllocator< RT, TT, SORTED >::grow_hole ( unsigned index,
Range & range,
RT bound,
bool before )

◆ operator=() [1/2]

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

◆ operator=() [2/2]

template<typename RT, typename TT, bool SORTED>
SizedRangeAllocator & Realm::SizedRangeAllocator< RT, TT, SORTED >::operator= ( SizedRangeAllocator< RT, TT, SORTED > && )
defaultnoexcept

◆ remove_from_free_list()

template<typename RT, typename TT, bool SORTED>
void Realm::SizedRangeAllocator< RT, TT, SORTED >::remove_from_free_list ( unsigned index,
Range & range )

◆ split_range()

template<typename RT, typename TT, bool SORTED>
size_t Realm::SizedRangeAllocator< RT, TT, SORTED >::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, bool SORTED>
void Realm::SizedRangeAllocator< RT, TT, SORTED >::swap ( SizedRangeAllocator< RT, TT, SORTED > & swap_with)

Member Data Documentation

◆ SENTINEL

template<typename RT, typename TT, bool SORTED>
unsigned Realm::SizedRangeAllocator< RT, TT, SORTED >::SENTINEL = BasicRangeAllocator<RT, TT>::SENTINEL
staticconstexpr

◆ size_based_free_lists

template<typename RT, typename TT, bool SORTED>
std::vector<unsigned> Realm::SizedRangeAllocator< RT, TT, SORTED >::size_based_free_lists
protected

The documentation for this class was generated from the following file:
  • /home/runner/work/realm/realm/realm-src/src/realm/mem_impl.h