6 #ifndef BITCOIN_SUPPORT_ALLOCATORS_SECURE_H 7 #define BITCOIN_SUPPORT_ALLOCATORS_SECURE_H 31 throw std::bad_alloc();
70 template<
typename T,
typename... Args>
84 #endif // BITCOIN_SUPPORT_ALLOCATORS_SECURE_H
secure_unique_ptr< T > make_secure_unique(Args &&... as)
static LockedPoolManager & Instance()
Return the current instance, or create it once.
friend bool operator==(const secure_allocator &, const secure_allocator< U > &) noexcept
std::basic_string< char, std::char_traits< char >, secure_allocator< char > > SecureString
std::unique_ptr< T, SecureUniqueDeleter< T > > secure_unique_ptr
void memory_cleanse(void *ptr, size_t len)
Secure overwrite a buffer (possibly containing secret data) with zero-bytes.
secure_allocator(const secure_allocator< U > &) noexcept
T * allocate(std::size_t n)
void * alloc(size_t size)
Allocate size bytes from this arena.
friend bool operator!=(const secure_allocator &, const secure_allocator< U > &) noexcept
void operator()(T *t) noexcept
void free(void *ptr)
Free a previously allocated chunk of memory.
secure_allocator()=default
void deallocate(T *p, std::size_t n)
#define T(expected, seed, data)