WPILibC++ 2025.1.1
Loading...
Searching...
No Matches
wpi::memory::detail Namespace Reference

Namespaces

namespace  swap_
 

Classes

struct  check_standard_allocator
 
struct  chunk_base
 
class  deeply_tracked_block_allocator
 
class  ebo_storage
 
struct  fallback_type
 
struct  fallback_type< binary_segregator< Segregator, Fallback > >
 
class  fixed_memory_stack
 
class  free_list_array
 
class  free_memory_list
 
class  global_leak_checker_impl
 
struct  has_invalid_alloc_function
 
struct  has_invalid_dealloc_function
 
struct  has_invalid_try_alloc_function
 
struct  has_invalid_try_dealloc_function
 
struct  heap_allocator_impl
 
struct  identity_access_policy
 
struct  is_block_or_raw_allocator
 
struct  is_block_or_raw_allocator_impl
 
struct  is_block_or_raw_allocator_impl< T, false >
 
struct  is_composable_allocator
 
struct  is_composable_allocator< T, std::integral_constant< bool, true > >
 
struct  is_instantiation_of
 
struct  is_instantiation_of< Template, Template< Args... > >
 
struct  is_raw_allocator
 
struct  is_raw_allocator< T, std::integral_constant< bool, true > >
 
class  joint_stack
 
class  locked_allocator
 
struct  log2_access_policy
 
class  lowlevel_allocator
 
struct  lowlevel_allocator_leak_handler
 
struct  make_segregator_t
 
struct  make_segregator_t< Segregatable >
 
struct  make_segregator_t< Segregatable, RawAllocator >
 
struct  make_segregator_t< Segregatable, Tail... >
 
struct  malloc_allocator_impl
 
class  memory_arena_cache
 
class  memory_arena_cache< cached_arena >
 
class  memory_arena_cache< uncached_arena >
 
class  memory_block_stack
 
struct  memory_pool_collection_leak_handler
 
struct  memory_pool_leak_handler
 
struct  memory_stack_leak_handler
 
class  mutex_storage
 
class  mutex_storage< no_mutex >
 
struct  new_allocator_impl
 
class  no_leak_checker
 
class  object_leak_checker
 
class  ordered_free_memory_list
 
struct  rebind_block_allocator
 
struct  rebind_block_allocator< RawAllocator< Args... >, OtherBlockAllocator >
 
struct  reference_shared
 
struct  reference_stateful
 
struct  reference_stateless
 
class  reference_storage_impl
 
class  reference_storage_impl< RawAllocator, reference_shared >
 
class  reference_storage_impl< RawAllocator, reference_stateful >
 
class  reference_storage_impl< RawAllocator, reference_stateless >
 
struct  segregatable_type
 
struct  segregatable_type< 0, binary_segregator< Segregator, Fallback > >
 
struct  segregatable_type< I, binary_segregator< Segregator, Fallback > >
 
class  small_free_memory_list
 
class  stack_marker
 
class  temporary_block_allocator
 
class  temporary_stack_list_node
 
struct  virtual_memory_allocator_leak_handler
 

Typedefs

using temporary_stack_impl = memory_stack<temporary_block_allocator>
 
template<class Tracker , class RawAllocator >
using deeply_tracked_block_allocator_for
 
template<class Tracker , class RawAllocator >
using rebound_allocator
 
using node_free_memory_list = free_memory_list
 
using array_free_memory_list = ordered_free_memory_list
 
using debug_fill_enabled = std::integral_constant<bool, WPI_MEMORY_DEBUG_FILL>
 
template<class Handler >
using global_leak_checker = no_leak_checker<int>
 
template<class Handler >
using default_leak_checker = no_leak_checker<Handler>
 
template<class RawAlloc >
using default_block_wrapper = growing_block_allocator<RawAlloc>
 
template<class RawAllocator , class Mutex >
using mutex_for
 
template<class BlockOrRawAllocator >
using iteration_block_allocator
 

Functions

void handle_failed_assert (const char *msg, const char *file, int line, const char *fnc) noexcept
 
void handle_warning (const char *msg, const char *file, int line, const char *fnc) noexcept
 
template<class Allocator , class Tracker >
auto set_tracker (int, Allocator &allocator, Tracker *tracker) noexcept -> decltype(allocator.get_allocator().set_tracker(tracker))
 
template<class Allocator , class Tracker >
void set_tracker (short, Allocator &, Tracker *) noexcept
 
template<class Alloc >
void * try_allocate_node (std::true_type, Alloc &alloc, std::size_t size, std::size_t alignment) noexcept
 
template<class Alloc >
void * try_allocate_array (std::true_type, Alloc &alloc, std::size_t count, std::size_t size, std::size_t alignment) noexcept
 
template<class Alloc >
bool try_deallocate_node (std::true_type, Alloc &alloc, void *ptr, std::size_t size, std::size_t alignment) noexcept
 
template<class Alloc >
bool try_deallocate_array (std::true_type, Alloc &alloc, void *ptr, std::size_t count, std::size_t size, std::size_t alignment) noexcept
 
template<class Alloc >
void * try_allocate_node (std::false_type, Alloc &, std::size_t, std::size_t) noexcept
 
template<class Alloc >
void * try_allocate_array (std::false_type, Alloc &, std::size_t, std::size_t, std::size_t) noexcept
 
template<class Alloc >
bool try_deallocate_node (std::false_type, Alloc &, void *, std::size_t, std::size_t) noexcept
 
template<class Alloc >
bool try_deallocate_array (std::false_type, Alloc &, void *, std::size_t, std::size_t, std::size_t) noexcept
 
reference_stateful reference_type (std::true_type stateful, std::false_type shared)
 
reference_stateless reference_type (std::false_type stateful, std::true_type shared)
 
reference_stateless reference_type (std::false_type stateful, std::false_type shared)
 
reference_shared reference_type (std::true_type stateful, std::true_type shared)
 
constexpr bool is_valid_alignment (std::size_t alignment) noexcept
 
std::size_t align_offset (std::uintptr_t address, std::size_t alignment) noexcept
 
std::size_t align_offset (void *ptr, std::size_t alignment) noexcept
 
bool is_aligned (void *ptr, std::size_t alignment) noexcept
 
std::size_t alignment_for (std::size_t size) noexcept
 
void swap (free_memory_list &a, free_memory_list &b)
 
void swap (ordered_free_memory_list &a, ordered_free_memory_list &b)
 
template<typename T , class RawAllocator , typename... Args>
auto allocate_unique (allocator_reference< RawAllocator > alloc, Args &&... args) -> std::unique_ptr< T, allocator_deleter< T, RawAllocator > >
 
template<typename T , typename... Args>
void construct (std::true_type, T *cur, T *end, Args &&... args)
 
template<typename T , typename... Args>
void construct (std::false_type, T *begin, T *end, Args &&... args)
 
template<typename T , class RawAllocator >
auto allocate_array_unique (std::size_t size, allocator_reference< RawAllocator > alloc) -> std::unique_ptr< T[], allocator_deleter< T[], RawAllocator > >
 
void debug_fill (void *, std::size_t, debug_magic) noexcept
 
void * debug_is_filled (void *, std::size_t, debug_magic) noexcept
 
void * debug_fill_new (void *memory, std::size_t, std::size_t) noexcept
 
void * debug_fill_free (void *memory, std::size_t, std::size_t) noexcept
 
void debug_fill_internal (void *, std::size_t, bool) noexcept
 
void debug_handle_invalid_ptr (const allocator_info &info, void *ptr)
 
template<class Functor >
void debug_check_pointer (Functor condition, const allocator_info &info, void *ptr)
 
template<class Functor >
void debug_check_double_dealloc (Functor condition, const allocator_info &info, void *ptr)
 
void debug_handle_memory_leak (const allocator_info &info, std::ptrdiff_t amount)
 
template<class Ex , typename Func >
void check_allocation_size (std::size_t passed, Func f, const allocator_info &info)
 
template<class Ex >
void check_allocation_size (std::size_t passed, std::size_t supported, const allocator_info &info)
 
template<class BlockAllocator >
std::true_type is_block_allocator_impl (int,,,)
 
template<typename T >
std::false_type is_block_allocator_impl (short)
 
template<template< class... > class Wrapper, class BlockAllocator , typename... Args>
BlockAllocator make_block_allocator (std::true_type, std::size_t block_size, Args &&... args)
 
template<template< class... > class Wrapper, class RawAlloc >
auto make_block_allocator (std::false_type, std::size_t block_size, RawAlloc alloc=RawAlloc()) -> Wrapper< RawAlloc >
 
template<class Allocator >
std::true_type has_construct (int,)
 
template<class Allocator >
std::false_type has_construct (short)
 
template<class Allocator >
std::true_type has_destroy (int,)
 
template<class Allocator >
std::false_type has_destroy (short)
 
template<class RawAllocator >
allocator_traits< RawAllocator >::foonathan_memory_default_traits alloc_uses_default_traits (RawAllocator &)
 
std::false_type alloc_uses_default_traits (...)
 
template<class RawAllocator >
composable_allocator_traits< RawAllocator >::foonathan_memory_default_traits composable_alloc_uses_default_traits (RawAllocator &)
 
std::false_type composable_alloc_uses_default_traits (...)
 
template<typename UInt >
constexpr bool is_power_of_two (UInt x)
 
std::size_t ilog2_base (std::uint64_t x)
 
std::size_t ilog2 (std::uint64_t x)
 
std::size_t ilog2_ceil (std::uint64_t x)
 
template<typename T >
detail::joint_stackget_stack (joint_type< T > &obj) noexcept
 
template<typename T >
const detail::joint_stackget_stack (const joint_type< T > &obj) noexcept
 
template<typename T >
char * get_memory (joint_type< T > &obj) noexcept
 
template<typename T >
const char * get_memory (const joint_type< T > &obj) noexcept
 
template<typename T >
std::remove_reference< T >::type && move (T &&arg) noexcept
 
template<class T >
T && forward (typename std::remove_reference< T >::type &t) noexcept
 
template<class T >
T && forward (typename std::remove_reference< T >::type &&t) noexcept
 
template<typename T >
void adl_swap (T &a, T &b) noexcept
 
template<class Alloc , class Mutex >
locked_allocator< Alloc, Mutex > lock_allocator (Alloc &a, Mutex &m)
 
void swap (small_free_memory_list &a, small_free_memory_list &b)
 
template<class Segregator , class Fallback = null_allocator>
auto make_segregator (Segregator &&seg, Fallback &&f=null_allocator{}) -> binary_segregator< typename std::decay< Segregator >::type, typename std::decay< Fallback >::type >
 
template<class Segregator , typename... Rest>
auto make_segregator (Segregator &&seg, Rest &&... rest) -> binary_segregator< typename std::decay< Segregator >::type, decltype(make_segregator(std::forward< Rest >(rest)...))>
 

Variables

constexpr std::size_t max_alignment = alignof(std::max_align_t)
 
constexpr std::size_t debug_fence_size
 
constexpr std::size_t chunk_memory_offset
 
constexpr std::size_t chunk_max_nodes = UCHAR_MAX
 

Typedef Documentation

◆ array_free_memory_list

◆ debug_fill_enabled

using wpi::memory::detail::debug_fill_enabled = std::integral_constant<bool, WPI_MEMORY_DEBUG_FILL>

◆ deeply_tracked_block_allocator_for

template<class Tracker , class RawAllocator >
using wpi::memory::detail::deeply_tracked_block_allocator_for
Initial value:
typename RawAllocator::allocator_type>
implementation_defined deeply_tracked_block_allocator
Similar to tracked_block_allocator, but shares the tracker with the higher level allocator.
Definition tracking.hpp:159

◆ default_block_wrapper

template<class RawAlloc >
using wpi::memory::detail::default_block_wrapper = growing_block_allocator<RawAlloc>

◆ default_leak_checker

template<class Handler >
using wpi::memory::detail::default_leak_checker = no_leak_checker<Handler>

◆ global_leak_checker

template<class Handler >
using wpi::memory::detail::global_leak_checker = no_leak_checker<int>

◆ iteration_block_allocator

template<class BlockOrRawAllocator >
using wpi::memory::detail::iteration_block_allocator
Initial value:
make_block_allocator_t<BlockOrRawAllocator, fixed_block_allocator>

◆ mutex_for

template<class RawAllocator , class Mutex >
using wpi::memory::detail::mutex_for
Initial value:
typename std::conditional<is_thread_safe_allocator<RawAllocator>::value, no_mutex,
Mutex>::type

◆ node_free_memory_list

◆ rebound_allocator

template<class Tracker , class RawAllocator >
using wpi::memory::detail::rebound_allocator
Initial value:
typename rebind_block_allocator<
RawAllocator, deeply_tracked_block_allocator_for<Tracker, RawAllocator>>::type

◆ temporary_stack_impl

Function Documentation

◆ adl_swap()

template<typename T >
void wpi::memory::detail::adl_swap ( T & a,
T & b )
noexcept

◆ align_offset() [1/2]

std::size_t wpi::memory::detail::align_offset ( std::uintptr_t address,
std::size_t alignment )
inlinenoexcept

◆ align_offset() [2/2]

std::size_t wpi::memory::detail::align_offset ( void * ptr,
std::size_t alignment )
inlinenoexcept

◆ alignment_for()

std::size_t wpi::memory::detail::alignment_for ( std::size_t size)
noexcept

◆ alloc_uses_default_traits() [1/2]

std::false_type wpi::memory::detail::alloc_uses_default_traits ( ...)

◆ alloc_uses_default_traits() [2/2]

template<class RawAllocator >
allocator_traits< RawAllocator >::foonathan_memory_default_traits wpi::memory::detail::alloc_uses_default_traits ( RawAllocator & )

◆ allocate_array_unique()

template<typename T , class RawAllocator >
auto wpi::memory::detail::allocate_array_unique ( std::size_t size,
allocator_reference< RawAllocator > alloc ) -> std::unique_ptr<T[], allocator_deleter<T[], RawAllocator>>

◆ allocate_unique()

template<typename T , class RawAllocator , typename... Args>
auto wpi::memory::detail::allocate_unique ( allocator_reference< RawAllocator > alloc,
Args &&... args ) -> std::unique_ptr<T, allocator_deleter<T, RawAllocator>>

◆ check_allocation_size() [1/2]

template<class Ex , typename Func >
void wpi::memory::detail::check_allocation_size ( std::size_t passed,
Func f,
const allocator_info & info )

◆ check_allocation_size() [2/2]

template<class Ex >
void wpi::memory::detail::check_allocation_size ( std::size_t passed,
std::size_t supported,
const allocator_info & info )

◆ composable_alloc_uses_default_traits() [1/2]

std::false_type wpi::memory::detail::composable_alloc_uses_default_traits ( ...)

◆ composable_alloc_uses_default_traits() [2/2]

template<class RawAllocator >
composable_allocator_traits< RawAllocator >::foonathan_memory_default_traits wpi::memory::detail::composable_alloc_uses_default_traits ( RawAllocator & )

◆ construct() [1/2]

template<typename T , typename... Args>
void wpi::memory::detail::construct ( std::false_type ,
T * begin,
T * end,
Args &&... args )

◆ construct() [2/2]

template<typename T , typename... Args>
void wpi::memory::detail::construct ( std::true_type ,
T * cur,
T * end,
Args &&... args )

◆ debug_check_double_dealloc()

template<class Functor >
void wpi::memory::detail::debug_check_double_dealloc ( Functor condition,
const allocator_info & info,
void * ptr )

◆ debug_check_pointer()

template<class Functor >
void wpi::memory::detail::debug_check_pointer ( Functor condition,
const allocator_info & info,
void * ptr )

◆ debug_fill()

void wpi::memory::detail::debug_fill ( void * ,
std::size_t ,
debug_magic  )
inlinenoexcept

◆ debug_fill_free()

void * wpi::memory::detail::debug_fill_free ( void * memory,
std::size_t ,
std::size_t  )
inlinenoexcept

◆ debug_fill_internal()

void wpi::memory::detail::debug_fill_internal ( void * ,
std::size_t ,
bool  )
inlinenoexcept

◆ debug_fill_new()

void * wpi::memory::detail::debug_fill_new ( void * memory,
std::size_t ,
std::size_t  )
inlinenoexcept

◆ debug_handle_invalid_ptr()

void wpi::memory::detail::debug_handle_invalid_ptr ( const allocator_info & info,
void * ptr )

◆ debug_handle_memory_leak()

void wpi::memory::detail::debug_handle_memory_leak ( const allocator_info & info,
std::ptrdiff_t amount )

◆ debug_is_filled()

void * wpi::memory::detail::debug_is_filled ( void * ,
std::size_t ,
debug_magic  )
inlinenoexcept

◆ forward() [1/2]

template<class T >
T && wpi::memory::detail::forward ( typename std::remove_reference< T >::type && t)
noexcept

◆ forward() [2/2]

template<class T >
T && wpi::memory::detail::forward ( typename std::remove_reference< T >::type & t)
noexcept

◆ get_memory() [1/2]

template<typename T >
const char * wpi::memory::detail::get_memory ( const joint_type< T > & obj)
noexcept

◆ get_memory() [2/2]

template<typename T >
char * wpi::memory::detail::get_memory ( joint_type< T > & obj)
noexcept

◆ get_stack() [1/2]

template<typename T >
const detail::joint_stack & wpi::memory::detail::get_stack ( const joint_type< T > & obj)
noexcept

◆ get_stack() [2/2]

template<typename T >
detail::joint_stack & wpi::memory::detail::get_stack ( joint_type< T > & obj)
noexcept

◆ handle_failed_assert()

void wpi::memory::detail::handle_failed_assert ( const char * msg,
const char * file,
int line,
const char * fnc )
noexcept

◆ handle_warning()

void wpi::memory::detail::handle_warning ( const char * msg,
const char * file,
int line,
const char * fnc )
noexcept

◆ has_construct() [1/2]

template<class Allocator >
std::true_type wpi::memory::detail::has_construct ( int )

◆ has_construct() [2/2]

template<class Allocator >
std::false_type wpi::memory::detail::has_construct ( short )

◆ has_destroy() [1/2]

template<class Allocator >
std::true_type wpi::memory::detail::has_destroy ( int )

◆ has_destroy() [2/2]

template<class Allocator >
std::false_type wpi::memory::detail::has_destroy ( short )

◆ ilog2()

std::size_t wpi::memory::detail::ilog2 ( std::uint64_t x)
inline

◆ ilog2_base()

std::size_t wpi::memory::detail::ilog2_base ( std::uint64_t x)
inline

◆ ilog2_ceil()

std::size_t wpi::memory::detail::ilog2_ceil ( std::uint64_t x)
inline

◆ is_aligned()

bool wpi::memory::detail::is_aligned ( void * ptr,
std::size_t alignment )
noexcept

◆ is_block_allocator_impl() [1/2]

template<class BlockAllocator >
std::true_type wpi::memory::detail::is_block_allocator_impl ( int )

◆ is_block_allocator_impl() [2/2]

template<typename T >
std::false_type wpi::memory::detail::is_block_allocator_impl ( short )

◆ is_power_of_two()

template<typename UInt >
bool wpi::memory::detail::is_power_of_two ( UInt x)
constexpr

◆ is_valid_alignment()

bool wpi::memory::detail::is_valid_alignment ( std::size_t alignment)
constexprnoexcept

◆ lock_allocator()

template<class Alloc , class Mutex >
locked_allocator< Alloc, Mutex > wpi::memory::detail::lock_allocator ( Alloc & a,
Mutex & m )

◆ make_block_allocator() [1/2]

template<template< class... > class Wrapper, class RawAlloc >
auto wpi::memory::detail::make_block_allocator ( std::false_type ,
std::size_t block_size,
RawAlloc alloc = RawAlloc() ) -> Wrapper<RawAlloc>

◆ make_block_allocator() [2/2]

template<template< class... > class Wrapper, class BlockAllocator , typename... Args>
BlockAllocator wpi::memory::detail::make_block_allocator ( std::true_type ,
std::size_t block_size,
Args &&... args )

◆ make_segregator() [1/2]

template<class Segregator , class Fallback = null_allocator>
auto wpi::memory::detail::make_segregator ( Segregator && seg,
Fallback && f = null_allocator{} ) -> binary_segregator<typename std::decay<Segregator>::type, typename std::decay<Fallback>::type>

◆ make_segregator() [2/2]

template<class Segregator , typename... Rest>
auto wpi::memory::detail::make_segregator ( Segregator && seg,
Rest &&... rest ) -> binary_segregator<typename std::decay<Segregator>::type, decltype(make_segregator(std::forward<Rest>(rest)...))>

◆ move()

template<typename T >
std::remove_reference< T >::type && wpi::memory::detail::move ( T && arg)
noexcept

◆ reference_type() [1/4]

reference_stateless wpi::memory::detail::reference_type ( std::false_type stateful,
std::false_type shared )

◆ reference_type() [2/4]

reference_stateless wpi::memory::detail::reference_type ( std::false_type stateful,
std::true_type shared )

◆ reference_type() [3/4]

reference_stateful wpi::memory::detail::reference_type ( std::true_type stateful,
std::false_type shared )

◆ reference_type() [4/4]

reference_shared wpi::memory::detail::reference_type ( std::true_type stateful,
std::true_type shared )

◆ set_tracker() [1/2]

template<class Allocator , class Tracker >
auto wpi::memory::detail::set_tracker ( int ,
Allocator & allocator,
Tracker * tracker ) -> decltype(allocator.get_allocator().set_tracker(tracker))
noexcept

◆ set_tracker() [2/2]

template<class Allocator , class Tracker >
void wpi::memory::detail::set_tracker ( short ,
Allocator & ,
Tracker *  )
noexcept

◆ swap() [1/3]

void wpi::memory::detail::swap ( free_memory_list & a,
free_memory_list & b )
noexcept

◆ swap() [2/3]

void wpi::memory::detail::swap ( ordered_free_memory_list & a,
ordered_free_memory_list & b )
noexcept

◆ swap() [3/3]

void wpi::memory::detail::swap ( small_free_memory_list & a,
small_free_memory_list & b )
noexcept

◆ try_allocate_array() [1/2]

template<class Alloc >
void * wpi::memory::detail::try_allocate_array ( std::false_type ,
Alloc & ,
std::size_t ,
std::size_t ,
std::size_t  )
noexcept

◆ try_allocate_array() [2/2]

template<class Alloc >
void * wpi::memory::detail::try_allocate_array ( std::true_type ,
Alloc & alloc,
std::size_t count,
std::size_t size,
std::size_t alignment )
noexcept

◆ try_allocate_node() [1/2]

template<class Alloc >
void * wpi::memory::detail::try_allocate_node ( std::false_type ,
Alloc & ,
std::size_t ,
std::size_t  )
noexcept

◆ try_allocate_node() [2/2]

template<class Alloc >
void * wpi::memory::detail::try_allocate_node ( std::true_type ,
Alloc & alloc,
std::size_t size,
std::size_t alignment )
noexcept

◆ try_deallocate_array() [1/2]

template<class Alloc >
bool wpi::memory::detail::try_deallocate_array ( std::false_type ,
Alloc & ,
void * ,
std::size_t ,
std::size_t ,
std::size_t  )
noexcept

◆ try_deallocate_array() [2/2]

template<class Alloc >
bool wpi::memory::detail::try_deallocate_array ( std::true_type ,
Alloc & alloc,
void * ptr,
std::size_t count,
std::size_t size,
std::size_t alignment )
noexcept

◆ try_deallocate_node() [1/2]

template<class Alloc >
bool wpi::memory::detail::try_deallocate_node ( std::false_type ,
Alloc & ,
void * ,
std::size_t ,
std::size_t  )
noexcept

◆ try_deallocate_node() [2/2]

template<class Alloc >
bool wpi::memory::detail::try_deallocate_node ( std::true_type ,
Alloc & alloc,
void * ptr,
std::size_t size,
std::size_t alignment )
noexcept

Variable Documentation

◆ chunk_max_nodes

std::size_t wpi::memory::detail::chunk_max_nodes = UCHAR_MAX
constexpr

◆ chunk_memory_offset

std::size_t wpi::memory::detail::chunk_memory_offset
constexpr
Initial value:
=
sizeof(chunk_base) % detail::max_alignment == 0 ?
sizeof(chunk_base) :
(sizeof(chunk_base) / detail::max_alignment + 1) * detail::max_alignment

◆ debug_fence_size

std::size_t wpi::memory::detail::debug_fence_size
constexpr
Initial value:
=
#define WPI_MEMORY_DEBUG_FENCE
The size of the fence memory, it has no effect if WPI_MEMORY_DEBUG_FILL is false.
Definition config.hpp:114
#define WPI_MEMORY_DEBUG_FILL
Whether or not allocated memory will be filled with special values.
Definition config.hpp:109

◆ max_alignment

std::size_t wpi::memory::detail::max_alignment = alignof(std::max_align_t)
constexpr