6 #ifndef BITCOIN_SUPPORT_ALLOCATORS_SECURE_H
7 #define BITCOIN_SUPPORT_ALLOCATORS_SECURE_H
20 typedef std::allocator<T>
base;
33 template <
typename _Other>
struct rebind {
37 T *
allocate(std::size_t n,
const void *hint = 0) {
38 T *allocation =
static_cast<T *
>(
41 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
base::value_type value_type
base::const_reference const_reference
base::difference_type difference_type
base::reference reference
secure_allocator(const secure_allocator< U > &a) noexcept
~secure_allocator() noexcept
base::size_type size_type
base::const_pointer const_pointer
secure_allocator() noexcept
secure_allocator(const secure_allocator &a) noexcept
T * allocate(std::size_t n, const void *hint=0)
void deallocate(T *p, std::size_t n)