Botan 3.9.0
Crypto and TLS for C&
Botan::secure_allocator< T > Class Template Reference

#include <secmem.h>

Public Types

typedef std::size_t size_type
typedef T value_type

Public Member Functions

T * allocate (std::size_t n)
void deallocate (T *p, std::size_t n)
secure_allocatoroperator= (const secure_allocator &) noexcept=default
secure_allocatoroperator= (secure_allocator &&) noexcept=default
 secure_allocator () noexcept=default
 secure_allocator (const secure_allocator &) noexcept=default
template<typename U>
 secure_allocator (const secure_allocator< U > &) noexcept
 secure_allocator (secure_allocator &&) noexcept=default
 ~secure_allocator () noexcept=default

Detailed Description

template<typename T>
requires std::is_integral_v<T> || std::is_enum_v<T>
class Botan::secure_allocator< T >

Definition at line 36 of file secmem.h.

Member Typedef Documentation

◆ size_type

template<typename T>
typedef std::size_t Botan::secure_allocator< T >::size_type

Definition at line 40 of file secmem.h.

◆ value_type

template<typename T>
typedef T Botan::secure_allocator< T >::value_type

Definition at line 39 of file secmem.h.

Constructor & Destructor Documentation

◆ secure_allocator() [1/4]

template<typename T>
Botan::secure_allocator< T >::secure_allocator ( )
defaultnoexcept

◆ secure_allocator() [2/4]

template<typename T>
Botan::secure_allocator< T >::secure_allocator ( const secure_allocator< T > & )
defaultnoexcept

References secure_allocator().

◆ secure_allocator() [3/4]

template<typename T>
Botan::secure_allocator< T >::secure_allocator ( secure_allocator< T > && )
defaultnoexcept

References secure_allocator().

◆ ~secure_allocator()

template<typename T>
Botan::secure_allocator< T >::~secure_allocator ( )
defaultnoexcept

References secure_allocator().

◆ secure_allocator() [4/4]

template<typename T>
template<typename U>
Botan::secure_allocator< T >::secure_allocator ( const secure_allocator< U > & )
inlineexplicitnoexcept

Definition at line 51 of file secmem.h.

51{}

References secure_allocator().

Member Function Documentation

◆ allocate()

template<typename T>
T * Botan::secure_allocator< T >::allocate ( std::size_t n)
inline

Definition at line 53 of file secmem.h.

53{ return static_cast<T*>(allocate_memory(n, sizeof(T))); }
BOTAN_MALLOC_FN void * allocate_memory(size_t elems, size_t elem_size)
Definition allocator.cpp:21

References Botan::allocate_memory().

◆ deallocate()

template<typename T>
void Botan::secure_allocator< T >::deallocate ( T * p,
std::size_t n )
inline

Definition at line 55 of file secmem.h.

55{ deallocate_memory(p, n, sizeof(T)); }
void deallocate_memory(void *p, size_t elems, size_t elem_size)
Definition allocator.cpp:48

References Botan::deallocate_memory().

◆ operator=() [1/2]

template<typename T>
secure_allocator & Botan::secure_allocator< T >::operator= ( const secure_allocator< T > & )
defaultnoexcept

References secure_allocator().

◆ operator=() [2/2]

template<typename T>
secure_allocator & Botan::secure_allocator< T >::operator= ( secure_allocator< T > && )
defaultnoexcept

References secure_allocator().


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