6#ifndef BITCOIN_SUPPORT_ALLOCATORS_SECURE_H
7#define BITCOIN_SUPPORT_ALLOCATORS_SECURE_H
31 throw std::bad_alloc();
70template<
typename T,
typename... Args>
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.
#define T(expected, seed, data)
std::basic_string< char, std::char_traits< char >, secure_allocator< char > > SecureString
secure_unique_ptr< T > make_secure_unique(Args &&... as)
std::unique_ptr< T, SecureUniqueDeleter< T > > secure_unique_ptr
void operator()(T *t) noexcept
friend bool operator==(const secure_allocator &, const secure_allocator< U > &) noexcept
secure_allocator(const secure_allocator< U > &) noexcept
friend bool operator!=(const secure_allocator &, const secure_allocator< U > &) noexcept
secure_allocator()=default
T * allocate(std::size_t n)
void deallocate(T *p, std::size_t n)