MySQL 8.0.39
Source Code Documentation
|
Memory layout representation of PFS metadata segment that is used by the allocator variants which also want to trace the memory consumption through PFS (PSI) interface. More...
#include <pfs.h>
Public Types | |
using | pfs_owning_thread_t = PSI_thread * |
Convenience types that we will be using to serialize necessary details into the Aligned_alloc metadata (allocator and PFS) segments. More... | |
using | pfs_datalen_t = std::size_t |
using | pfs_memory_key_t = PSI_memory_key |
using | pfs_meta_offset_t = std::uint32_t |
using | data_segment_ptr = void * |
Static Public Member Functions | |
static void | pfs_owning_thread (data_segment_ptr data, pfs_owning_thread_t thread) noexcept |
Helper function which stores the PFS thread info into the OWNER field. More... | |
static void | pfs_datalen (data_segment_ptr data, size_t datalen) noexcept |
Helper function which stores the PFS datalen info into the DATALEN field. More... | |
static void | pfs_key (data_segment_ptr data, pfs_memory_key_t key) noexcept |
Helper function which stores the PFS key info into the KEY field. More... | |
static void | pfs_metaoffset (data_segment_ptr data, std::size_t alignment) noexcept |
Helper function which stores the offset to PFS metadata segment into the PFS-META-OFFSET field. More... | |
static pfs_owning_thread_t | pfs_owning_thread (data_segment_ptr data) noexcept |
Helper function which recovers the information user previously stored in OWNER field. More... | |
static pfs_datalen_t | pfs_datalen (data_segment_ptr data) noexcept |
Helper function which recovers the information user previously stored in DATALEN field. More... | |
static pfs_memory_key_t | pfs_key (data_segment_ptr data) noexcept |
Helper function which recovers the information user previously stored in KEY field. More... | |
static void * | deduce_pfs_meta (data_segment_ptr data) noexcept |
Helper function which deduces the pointer to the beginning of PFS metadata segment given the pointer to DATA segment. More... | |
Static Public Attributes | |
static constexpr auto | meta_size |
Metadata size. More... | |
static constexpr auto | size = meta_size + sizeof(pfs_meta_offset_t) |
Static Private Member Functions | |
static pfs_owning_thread_t * | ptr_to_pfs_owning_thread (data_segment_ptr data) noexcept |
Helper accessor function to OWNER metadata. More... | |
static pfs_datalen_t * | ptr_to_pfs_datalen (data_segment_ptr data) noexcept |
Helper accessor function to DATALEN metadata. More... | |
static pfs_memory_key_t * | ptr_to_pfs_key (data_segment_ptr data) noexcept |
Helper accessor function to PFS metadata. More... | |
static pfs_meta_offset_t * | ptr_to_pfs_meta_offset (data_segment_ptr data, std::size_t alignment) noexcept |
Helper accessor function to PFS-META-OFFSET metadata. More... | |
static pfs_meta_offset_t | pfs_meta_offset (data_segment_ptr data) noexcept |
Helper function which deduces PFS-META-OFFSET metadata value given the pointer to DATA segment. More... | |
Memory layout representation of PFS metadata segment that is used by the allocator variants which also want to trace the memory consumption through PFS (PSI) interface.
^ ^ ^ | | | | ------------------------— | | | OWNER | DATALEN | KEY | | | ------------------------— | | | ptr returned by | Aligned_alloc_impl | | ptr to be returned to call-site will be pointing here
PFS-META is a segment that will hold all the necessary details one needs to otherwise carry around in order to exercise the PFS memory tracing. Following data will be serialized into this segment: Owning thread Total length of bytes allocated Key
VARLEN is the leftover variable-length segment that specialized implementations can further make use of by deducing its size from the following formulae: requested_alignment - sizeof(PFS-META-OFFSET) - sizeof(PFS-META). In code that would be alignment - PFS_metadata::size. Not used by this implementation.
PFS-META-OFFSET is a field which allows us to recover the pointer to PFS-META segment from a pointer to DATA segment.
DATA is an actual segment which will keep the user data.
using ut::detail::PFS_metadata::data_segment_ptr = void * |
using ut::detail::PFS_metadata::pfs_datalen_t = std::size_t |
using ut::detail::PFS_metadata::pfs_meta_offset_t = std::uint32_t |
Convenience types that we will be using to serialize necessary details into the Aligned_alloc metadata (allocator and PFS) segments.
|
inlinestaticnoexcept |
Helper function which deduces the pointer to the beginning of PFS metadata segment given the pointer to DATA segment.
|
inlinestaticnoexcept |
Helper function which recovers the information user previously stored in DATALEN field.
|
inlinestaticnoexcept |
Helper function which stores the PFS datalen info into the DATALEN field.
|
inlinestaticnoexcept |
Helper function which recovers the information user previously stored in KEY field.
|
inlinestaticnoexcept |
Helper function which stores the PFS key info into the KEY field.
|
inlinestaticprivatenoexcept |
Helper function which deduces PFS-META-OFFSET metadata value given the pointer to DATA segment.
|
inlinestaticnoexcept |
Helper function which stores the offset to PFS metadata segment into the PFS-META-OFFSET field.
|
inlinestaticnoexcept |
Helper function which recovers the information user previously stored in OWNER field.
|
inlinestaticnoexcept |
Helper function which stores the PFS thread info into the OWNER field.
|
inlinestaticprivatenoexcept |
Helper accessor function to DATALEN metadata.
|
inlinestaticprivatenoexcept |
Helper accessor function to PFS metadata.
|
inlinestaticprivatenoexcept |
Helper accessor function to PFS-META-OFFSET metadata.
|
inlinestaticprivatenoexcept |
Helper accessor function to OWNER metadata.
|
staticconstexpr |
Metadata size.
|
staticconstexpr |