![]() |
MySQL 9.3.0
Source Code Documentation
|
Holds buckets with the given block size. More...
Classes | |
struct | BucketHash |
Public Member Functions | |
BucketPool ()=delete | |
BucketPool (std::size_t page_size, std::size_t block_size) | |
Creates the pool. More... | |
BucketPool (const BucketPool &)=delete | |
BucketPool (BucketPool &&)=delete | |
BucketPool & | operator= (const BucketPool &)=delete |
BucketPool & | operator= (BucketPool &&)=delete |
~BucketPool ()=default | |
std::size_t | page_size () const noexcept |
Page size for the buckets in this pool. More... | |
std::size_t | block_size () const noexcept |
Size of a single block of memory. More... | |
void * | allocate (std::size_t bytes) |
Allocates the given number of bytes. More... | |
void | deallocate (void *ptr, std::size_t bytes) noexcept |
Deallocates the given number of bytes. More... | |
Private Types | |
using | Buckets = std::unordered_set< BucketType, BucketHash > |
Private Member Functions | |
BucketType * | add_bucket (std::size_t size) |
void | remove_bucket (BucketType *bucket) |
BucketType * | find_bucket (const void *ptr) |
Finds the bucket which holds the given memory address. More... | |
Static Private Member Functions | |
static BucketType * | pointer (Buckets::const_iterator it) |
Private Attributes | |
const std::size_t | page_size_ |
const std::size_t | block_size_ |
std::mutex | mutex_ |
Buckets | buckets_ |
Buckets | full_buckets_ |
std::unordered_map< const void *, BucketType * > | memory_map_ |
const BucketType * | empty_bucket_ |
Holds buckets with the given block size.
|
private |
|
delete |
mysql_harness::SecureMemoryPool::BucketPool< BucketType >::BucketPool | ( | std::size_t | page_size, |
std::size_t | block_size | ||
) |
Creates the pool.
page_size | Page size for the buckets in this pool, size of each bucket is going to be a factor of this size. |
block_size | Blocks size for the buckets in this pool. |
|
delete |
|
delete |
|
default |
|
private |
void * mysql_harness::SecureMemoryPool::BucketPool< BucketType >::allocate | ( | std::size_t | bytes | ) |
Allocates the given number of bytes.
bytes | Number of bytes to allocate. |
|
inlinenoexcept |
Size of a single block of memory.
|
noexcept |
Deallocates the given number of bytes.
ptr | Memory previously allocated by this class. |
bytes | Size of the memory. |
|
private |
Finds the bucket which holds the given memory address.
|
delete |
|
delete |
|
inlinenoexcept |
Page size for the buckets in this pool.
|
inlinestaticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |