6 #ifndef BITCOIN_SUPPORT_ALLOCATORS_SECURE_H
7 #define BITCOIN_SUPPORT_ALLOCATORS_SECURE_H
21 using base = std::allocator<T>;
22 using traits = std::allocator_traits<base>;
35 template <
typename _Other>
40 T*
allocate(std::size_t n,
const void* hint =
nullptr)
44 throw std::bad_alloc();
void free(void *ptr)
Free a previously allocated chunk of memory.
void * alloc(size_t size)
Allocate size bytes from this arena.
static LockedPoolManager & Instance()
Return the current instance, or create it once.
void memory_cleanse(void *ptr, size_t len)
Secure overwrite a buffer (possibly containing secret data) with zero-bytes.
std::basic_string< char, std::char_traits< char >, secure_allocator< char > > SecureString
secure_allocator< _Other > other
std::allocator_traits< base > traits
typename traits::const_pointer const_pointer
typename traits::value_type value_type
typename traits::pointer pointer
typename traits::difference_type difference_type
secure_allocator(const secure_allocator< U > &a) noexcept
T * allocate(std::size_t n, const void *hint=nullptr)
~secure_allocator() noexcept
typename traits::size_type size_type
secure_allocator() noexcept
secure_allocator(const secure_allocator &a) noexcept
void deallocate(T *p, std::size_t n)