MySQL 9.3.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
mysql_harness::SecureMemoryPool::ContiguousBlocks Class Referencefinal

Allows to allocate multiple contiguous blocks of memory. More...

Public Member Functions

 ContiguousBlocks ()=delete
 
 ContiguousBlocks (const Bucket< ContiguousBlocks > &parent)
 
 ContiguousBlocks (const ContiguousBlocks &)=delete
 
 ContiguousBlocks (ContiguousBlocks &&)=delete
 
ContiguousBlocksoperator= (const ContiguousBlocks &)=delete
 
ContiguousBlocksoperator= (ContiguousBlocks &&)=delete
 
 ~ContiguousBlocks ()
 
void * allocate_blocks (std::size_t count) noexcept
 Allocates the given number of blocks. More...
 
void deallocate_blocks (void *ptr, std::size_t count) noexcept
 Deallocates the given number of blocks. More...
 

Private Member Functions

std::size_t find_contiguous_blocks (std::size_t count) const noexcept
 Finds the given number of contiguous blocks. More...
 
void set_in_use (std::size_t index, std::size_t count) noexcept
 Marks the given number of blocks starting at the given index as used. More...
 
void set_free (std::size_t index, std::size_t count) noexcept
 Marks the given number of blocks starting at the given index as unused. More...
 

Private Attributes

const Bucket< ContiguousBlocks > & parent_
 
unsigned char * index_
 

Detailed Description

Allows to allocate multiple contiguous blocks of memory.

Constructor & Destructor Documentation

◆ ContiguousBlocks() [1/4]

mysql_harness::SecureMemoryPool::ContiguousBlocks::ContiguousBlocks ( )
delete

◆ ContiguousBlocks() [2/4]

mysql_harness::SecureMemoryPool::ContiguousBlocks::ContiguousBlocks ( const Bucket< ContiguousBlocks > &  parent)
explicit

◆ ContiguousBlocks() [3/4]

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

◆ ContiguousBlocks() [4/4]

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

◆ ~ContiguousBlocks()

mysql_harness::SecureMemoryPool::ContiguousBlocks::~ContiguousBlocks ( )

Member Function Documentation

◆ allocate_blocks()

void * mysql_harness::SecureMemoryPool::ContiguousBlocks::allocate_blocks ( std::size_t  count)
noexcept

Allocates the given number of blocks.

Parameters
countNumber of blocks to allocate.
Returns
Allocated memory or nullptr if cannot allocate the requested amount of blocks.

◆ deallocate_blocks()

void mysql_harness::SecureMemoryPool::ContiguousBlocks::deallocate_blocks ( void *  ptr,
std::size_t  count 
)
noexcept

Deallocates the given number of blocks.

Parameters
ptrMemory previously allocated by this class.
countNumber of blocks.

◆ find_contiguous_blocks()

std::size_t mysql_harness::SecureMemoryPool::ContiguousBlocks::find_contiguous_blocks ( std::size_t  count) const
privatenoexcept

Finds the given number of contiguous blocks.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ set_free()

void mysql_harness::SecureMemoryPool::ContiguousBlocks::set_free ( std::size_t  index,
std::size_t  count 
)
privatenoexcept

Marks the given number of blocks starting at the given index as unused.

◆ set_in_use()

void mysql_harness::SecureMemoryPool::ContiguousBlocks::set_in_use ( std::size_t  index,
std::size_t  count 
)
privatenoexcept

Marks the given number of blocks starting at the given index as used.

Member Data Documentation

◆ index_

unsigned char* mysql_harness::SecureMemoryPool::ContiguousBlocks::index_
private

◆ parent_

const Bucket<ContiguousBlocks>& mysql_harness::SecureMemoryPool::ContiguousBlocks::parent_
private

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