#include <locking_allocator.h>
Definition at line 19 of file locking_allocator.h.
◆ mlock_allocator()
◆ allocate()
void * Botan::mlock_allocator::allocate |
( |
size_t |
num_elems, |
|
|
size_t |
elem_size |
|
) |
| |
Definition at line 14 of file locking_allocator.cpp.
15 {
16 if(!m_pool)
17 return nullptr;
18
19 const size_t n = num_elems * elem_size;
20 if(n / elem_size != num_elems)
21 return nullptr;
22
23 return m_pool->allocate(n);
24 }
◆ deallocate()
bool Botan::mlock_allocator::deallocate |
( |
void * |
p, |
|
|
size_t |
num_elems, |
|
|
size_t |
elem_size |
|
) |
| |
|
noexcept |
Definition at line 26 of file locking_allocator.cpp.
27 {
28 if(!m_pool)
29 return false;
30
31 size_t n = num_elems * elem_size;
32
33
34
35
36
37 if(n / elem_size != num_elems)
38 return false;
39
40 return m_pool->deallocate(p, n);
41 }
◆ instance()
◆ operator=()
The documentation for this class was generated from the following files: