Botan 3.6.1
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

Tallocate (std::size_t n)
 
void deallocate (T *p, std::size_t n)
 
secure_allocatoroperator= (const 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 () noexcept=default
 

Detailed Description

template<typename T>
requires std::is_integral<T>::value || std::is_enum<T>::value
class Botan::secure_allocator< T >

Definition at line 31 of file secmem.h.

Member Typedef Documentation

◆ size_type

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

Definition at line 35 of file secmem.h.

◆ value_type

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

Definition at line 34 of file secmem.h.

Constructor & Destructor Documentation

◆ secure_allocator() [1/3]

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

◆ secure_allocator() [2/3]

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

◆ ~secure_allocator()

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

◆ secure_allocator() [3/3]

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

Definition at line 43 of file secmem.h.

43{}

Member Function Documentation

◆ allocate()

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

Definition at line 45 of file secmem.h.

45{ return static_cast<T*>(allocate_memory(n, sizeof(T))); }
FE_25519 T
Definition ge.cpp:34
BOTAN_MALLOC_FN void * allocate_memory(size_t elems, size_t elem_size)
Definition allocator.cpp:20

References Botan::allocate_memory(), and T.

◆ deallocate()

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

Definition at line 47 of file secmem.h.

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

References Botan::deallocate_memory(), and T.

◆ operator=()

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

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