7#include <botan/allocator.h>
9#include <botan/mem_ops.h>
10#include <botan/internal/int_utils.h>
14#if defined(BOTAN_HAS_LOCKING_ALLOCATOR)
15 #include <botan/internal/locking_allocator.h>
21 if(elems == 0 || elem_size == 0) {
27 throw std::bad_alloc();
30#if defined(BOTAN_HAS_LOCKING_ALLOCATOR)
36#if defined(BOTAN_TARGET_OS_HAS_ALLOC_CONCEAL)
37 void* ptr = ::calloc_conceal(elems, elem_size);
39 void* ptr = std::calloc(elems, elem_size);
42 [[unlikely]]
throw std::bad_alloc();
54#if defined(BOTAN_HAS_LOCKING_ALLOCATOR)
64#if defined(BOTAN_HAS_LOCKING_ALLOCATOR)
static mlock_allocator & instance()
BOTAN_MALLOC_FN void * allocate_memory(size_t elems, size_t elem_size)
void deallocate_memory(void *p, size_t elems, size_t elem_size)
void secure_scrub_memory(void *ptr, size_t n)
constexpr std::optional< T > checked_mul(T a, T b)
void initialize_allocator()