Botan
1.10.9
|
#include <mem_pool.h>
Public Member Functions | |
void * | allocate (size_t) |
void | deallocate (void *, size_t) |
void | destroy () |
virtual void | init () |
Pooling_Allocator (Mutex *mutex) | |
virtual std::string | type () const =0 |
~Pooling_Allocator () | |
Static Public Member Functions | |
static Allocator * | get (bool locking) |
Pooling Allocator
Definition at line 22 of file mem_pool.h.
Botan::Pooling_Allocator::Pooling_Allocator | ( | Mutex * | mutex | ) |
mutex | used for internal locking |
Definition at line 99 of file mem_pool.cpp.
Botan::Pooling_Allocator::~Pooling_Allocator | ( | ) |
Definition at line 107 of file mem_pool.cpp.
|
virtual |
Allocate a block of memory
n | how many bytes to allocate |
Implements Botan::Allocator.
Definition at line 131 of file mem_pool.cpp.
References block_size, and Botan::round_up().
|
virtual |
Deallocate memory allocated with allocate()
ptr | the pointer returned by allocate() |
n | the size of the block pointed to by ptr |
Implements Botan::Allocator.
Definition at line 165 of file mem_pool.cpp.
References block_size, and Botan::round_up().
|
virtual |
Shutdown the allocator
Reimplemented from Botan::Allocator.
Definition at line 117 of file mem_pool.cpp.
|
staticinherited |
Acquire a pointer to an allocator
locking | is true if the allocator should attempt to secure the memory (eg for using to store keys) |
Definition at line 90 of file defalloc.cpp.
References alloc, Botan::Library_State::get_allocator(), Botan::Global_State_Management::global_state(), and Botan::Allocator::type().
Referenced by Botan::GMP_Engine::GMP_Engine(), and Botan::MemoryRegion< word >::init().
|
inlinevirtualinherited |
Initialize the allocator
Definition at line 53 of file allocate.h.
Referenced by Botan::Library_State::add_allocator().
|
pure virtualinherited |
Implemented in Botan::Locking_Allocator, Botan::MemoryMapping_Allocator, and Botan::Malloc_Allocator.
Referenced by Botan::Library_State::add_allocator(), and Botan::Allocator::get().