MySQL 9.3.0
Source Code Documentation
mysql_harness::SecureMemoryPool Class Referencefinal

Manages a pool of memory which is prevented from being swapped. More...

#include <secure_memory_pool.h>

Classes

class  Bucket
 A bucket of memory blocks of the given size. More...
 
class  BucketPool
 Holds buckets with the given block size. More...
 
class  ContiguousBlocks
 Allows to allocate multiple contiguous blocks of memory. More...
 
class  FixedBlock
 Allocates a single block of memory. More...
 

Public Member Functions

 SecureMemoryPool (const SecureMemoryPool &)=delete
 
 SecureMemoryPool (SecureMemoryPool &&)=delete
 
SecureMemoryPooloperator= (const SecureMemoryPool &)=delete
 
SecureMemoryPooloperator= (SecureMemoryPool &&)=delete
 
 ~SecureMemoryPool ()=default
 
void * allocate (std::size_t size)
 Allocates the given number of bytes. More...
 
void deallocate (void *ptr, std::size_t size) noexcept
 Deallocates the given number of bytes. More...
 

Static Public Member Functions

static SecureMemoryPoolget ()
 The single instance of this class. More...
 

Private Member Functions

 SecureMemoryPool ()
 

Private Attributes

std::vector< Bucket< FixedBlock > > fixed_buckets_
 
std::vector< std::mutex > fixed_buckets_mutexes_
 
BucketPool< Bucket< ContiguousBlocks > > large_pool_
 

Detailed Description

Manages a pool of memory which is prevented from being swapped.

Constructor & Destructor Documentation

◆ SecureMemoryPool() [1/3]

mysql_harness::SecureMemoryPool::SecureMemoryPool ( const SecureMemoryPool )
delete

◆ SecureMemoryPool() [2/3]

mysql_harness::SecureMemoryPool::SecureMemoryPool ( SecureMemoryPool &&  )
delete

◆ ~SecureMemoryPool()

mysql_harness::SecureMemoryPool::~SecureMemoryPool ( )
default

◆ SecureMemoryPool() [3/3]

mysql_harness::SecureMemoryPool::SecureMemoryPool ( )
private

Member Function Documentation

◆ allocate()

void * mysql_harness::SecureMemoryPool::allocate ( std::size_t  size)

Allocates the given number of bytes.

Parameters
sizeNumber of bytes to allocate.
Returns
Allocated memory.

◆ deallocate()

void mysql_harness::SecureMemoryPool::deallocate ( void *  ptr,
std::size_t  size 
)
noexcept

Deallocates the given number of bytes.

Parameters
ptrMemory previously allocated by this class.
sizeSize of the memory.

◆ get()

SecureMemoryPool & mysql_harness::SecureMemoryPool::get ( )
static

The single instance of this class.

◆ operator=() [1/2]

SecureMemoryPool & mysql_harness::SecureMemoryPool::operator= ( const SecureMemoryPool )
delete

◆ operator=() [2/2]

SecureMemoryPool & mysql_harness::SecureMemoryPool::operator= ( SecureMemoryPool &&  )
delete

Member Data Documentation

◆ fixed_buckets_

std::vector<Bucket<FixedBlock> > mysql_harness::SecureMemoryPool::fixed_buckets_
private

◆ fixed_buckets_mutexes_

std::vector<std::mutex> mysql_harness::SecureMemoryPool::fixed_buckets_mutexes_
private

◆ large_pool_

BucketPool<Bucket<ContiguousBlocks> > mysql_harness::SecureMemoryPool::large_pool_
private

The documentation for this class was generated from the following files: