Skip to content

raisim::AlignedAllocator ​

class · #include <raisim/helper.hpp>

cpp
template <typename T, std::size_t RSALOCATOR_ALIGNMENT>
class AlignedAllocator

Standard allocator that returns memory aligned to RSALOCATOR_ALIGNMENT bytes (e.g. for vectors of fixed-size Eigen-backed types).

Nested classes ​

  • struct rebind — Allocator for another element type with the same alignment.

Public types ​

value_type ​

cpp
using value_type = T

size_type ​

cpp
using size_type = std::size_t

difference_type ​

cpp
using difference_type = std::ptrdiff_t

propagate_on_container_move_assignment ​

cpp
using propagate_on_container_move_assignment = std::true_type

is_always_equal ​

cpp
using is_always_equal = std::true_type

Constructors & destructor ​

AlignedAllocator ​

cpp
AlignedAllocator() noexcept = default
cpp
template <typename U>
AlignedAllocator(const AlignedAllocator<U, RSALOCATOR_ALIGNMENT> &) noexcept

Converting copy (stateless allocator).

Public member functions ​

max_size ​

cpp
size_type max_size() const noexcept

Returns the largest element count that can be requested

allocate ​

cpp
T *allocate(size_type n)

Parameters

ParameterDescription
n (in)number of elements

Returns aligned uninitialized storage, or nullptr for n == 0. Throws std::bad_array_new_length if n > max_size()

deallocate ​

cpp
void deallocate(T *p, size_type) noexcept

Release storage obtained from allocate().

Parameters

ParameterDescription
p (in)pointer returned by allocate()

operator== ​

cpp
bool operator==(const AlignedAllocator &) const noexcept

Returns true; all instances are interchangeable

operator!= ​

cpp
bool operator!=(const AlignedAllocator &) const noexcept

Returns false; all instances are interchangeable

RaiSim — physics for robotics and AI.