aligator  0.16.0
A versatile and efficient C++ library for real-time constrained trajectory optimization.
Loading...
Searching...
No Matches
aligator::polymorphic_allocator Class Reference

A convenience subclass of std::pmr::polymorphic_allocator for bytes. More...

#include <aligator/memory/allocator.hpp>

Inheritance diagram for aligator::polymorphic_allocator:
[legend]
Collaboration diagram for aligator::polymorphic_allocator:
[legend]

Public Types

using base = std::pmr::polymorphic_allocator<std::byte>

Public Member Functions

 polymorphic_allocator () noexcept
 polymorphic_allocator (const polymorphic_allocator &other)=default
template<typename U>
 polymorphic_allocator (const std::pmr::polymorphic_allocator< U > &other) noexcept
 polymorphic_allocator (std::pmr::memory_resource *resource) noexcept
template<typename T>
T * allocate (size_t n, size_t alignment=EIGEN_DEFAULT_ALIGN_BYTES)
template<typename T>
void deallocate (T *p, size_t n, size_t alignment=EIGEN_DEFAULT_ALIGN_BYTES)
void * allocate_bytes (size_t num_bytes, size_t alignment=EIGEN_DEFAULT_ALIGN_BYTES)
void deallocate_bytes (void *p, size_t num_bytes, size_t alignment=EIGEN_DEFAULT_ALIGN_BYTES)

Detailed Description

A convenience subclass of std::pmr::polymorphic_allocator for bytes.

This subclass adds templated allocate() and deallocate() methods which take the desired pointer alignment as argument. This extends the standard C++ allocator API for convenience use with allocating buffers in vectorized linear algbera.

Definition at line 15 of file allocator.hpp.

Member Typedef Documentation

◆ base

using aligator::polymorphic_allocator::base = std::pmr::polymorphic_allocator<std::byte>

Definition at line 18 of file allocator.hpp.

Constructor & Destructor Documentation

◆ polymorphic_allocator() [1/4]

aligator::polymorphic_allocator::polymorphic_allocator()
inlinenoexcept

Definition at line 19 of file allocator.hpp.

◆ polymorphic_allocator() [2/4]

aligator::polymorphic_allocator::polymorphic_allocator(const polymorphic_allocator &other)
default

◆ polymorphic_allocator() [3/4]

template<typename U>
aligator::polymorphic_allocator::polymorphic_allocator(const std::pmr::polymorphic_allocator< U > &other)
inlinenoexcept

Definition at line 25 of file allocator.hpp.

◆ polymorphic_allocator() [4/4]

aligator::polymorphic_allocator::polymorphic_allocator(std::pmr::memory_resource *resource)
inlinenoexcept

Definition at line 29 of file allocator.hpp.

Member Function Documentation

◆ allocate()

template<typename T>
T * aligator::polymorphic_allocator::allocate(size_tn,
size_talignment = EIGEN_DEFAULT_ALIGN_BYTES )
inlinenodiscard

Definition at line 33 of file allocator.hpp.

◆ deallocate()

template<typename T>
void aligator::polymorphic_allocator::deallocate(T *p,
size_tn,
size_talignment = EIGEN_DEFAULT_ALIGN_BYTES )
inline

Definition at line 39 of file allocator.hpp.

◆ allocate_bytes()

void * aligator::polymorphic_allocator::allocate_bytes(size_tnum_bytes,
size_talignment = EIGEN_DEFAULT_ALIGN_BYTES )
inlinenodiscard

Definition at line 45 of file allocator.hpp.

◆ deallocate_bytes()

void aligator::polymorphic_allocator::deallocate_bytes(void *p,
size_tnum_bytes,
size_talignment = EIGEN_DEFAULT_ALIGN_BYTES )
inline

Definition at line 50 of file allocator.hpp.


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