29 #ifndef PIRANHA_CACHE_ALIGNING_ALLOCATOR_HPP 30 #define PIRANHA_CACHE_ALIGNING_ALLOCATOR_HPP 35 #include <piranha/dynamic_aligning_allocator.hpp> 37 #include <piranha/safe_cast.hpp> 38 #include <piranha/settings.hpp> 53 static std::size_t determine_alignment()
55 #if !defined(PIRANHA_HAVE_MEMORY_ALIGNMENT_PRIMITIVES) 103 template <
typename U,
typename... Args>
106 ::new (static_cast<void *>(p)) U(std::forward<Args>(args)...);
129 template <
typename U>
139 template <
typename U>
T const & const_reference
Const reference type.
std::size_t alignment() const
Alignment getter.
static unsigned get_cache_line_size()
Get the cache line size.
~cache_aligning_allocator()=default
Defaulted destructor.
Memory allocator with runtime alignment support.
cache_aligning_allocator(const cache_aligning_allocator< U > &other)
Copy-constructor from different instance.
cache_aligning_allocator(cache_aligning_allocator< U > &&other)
Move-constructor from different instance.
cache_aligning_allocator & operator=(const cache_aligning_allocator &other)=default
Copy assignment operator.
cache_aligning_allocator()
Default constructor.
void destroy(pointer p)
Destructor method.
void construct(U *p, Args &&... args)
Variadic construction method.
T & reference
Reference type.
T const * const_pointer
Const pointer type.
Allocator that tries to align memory to the cache line size.
Low-level memory management functions.
safe_cast_type< To, From > safe_cast(const From &x)
Safe cast.