8#include <botan/internal/locking_allocator.h>
10#include <botan/internal/int_utils.h>
11#include <botan/internal/mem_pool.h>
12#include <botan/internal/os_utils.h>
22 return m_pool->allocate(n.value());
35 return m_pool->deallocate(p, n.value());
49 if(mem_to_lock > 0 && mem_to_lock % page_size == 0) {
52 if(!m_locked_pages.empty()) {
53 m_pool = std::make_unique<Memory_Pool>(m_locked_pages, page_size);
74 return g_mlock_allocator;
bool deallocate(void *p, size_t num_elems, size_t elem_size) noexcept
void * allocate(size_t num_elems, size_t elem_size)
#define BOTAN_EARLY_INIT(prio)
size_t get_memory_locking_limit()
std::vector< void * > allocate_locked_pages(size_t count)
size_t system_page_size()
void free_locked_pages(const std::vector< void * > &pages)
constexpr std::optional< T > checked_mul(T a, T b)