MySQL 8.0.40
Source Code Documentation
|
Memory layout representation of metadata segment guaranteed by the inner workings of Aligned_alloc_impl. More...
#include <aligned_alloc.h>
Public Types | |
using | meta_1_t = Meta_1_type |
Convenience types that we will be using to serialize necessary details into the metadata segment. More... | |
using | meta_2_t = Meta_2_type |
using | unaligned_meta_2_t = meta_2_t |
Static Public Member Functions | |
static void | meta_1 (Aligned_alloc_impl::data_segment_ptr data, std::size_t meta_1_v) noexcept |
Bail out if we cannot fit the requested data size. More... | |
static void | meta_2 (Aligned_alloc_impl::data_segment_ptr data, std::size_t meta_2_v) noexcept |
Helper function which stores user-provided detail into the META_2 field. More... | |
static meta_1_t | meta_1 (Aligned_alloc_impl::data_segment_ptr data) noexcept |
Helper function which recovers the information user previously stored in META_1 field. More... | |
static meta_2_t | meta_2 (Aligned_alloc_impl::data_segment_ptr data) noexcept |
Helper function which recovers the information user previously stored in META_2 field. More... | |
Static Public Attributes | |
static constexpr auto | allocator_metadata_size |
Metadata size. More... | |
static constexpr auto | max_metadata_size = Aligned_alloc_impl::metadata_size |
Max metadata size. More... | |
Static Private Member Functions | |
static meta_1_t * | ptr_to_meta_1 (Aligned_alloc_impl::data_segment_ptr data) noexcept |
Helper accessor function to metadata (offset). More... | |
static unaligned_meta_2_t * | ptr_to_meta_2 (Aligned_alloc_impl::data_segment_ptr data) noexcept |
Helper accessor function to metadata (data length). More... | |
Memory layout representation of metadata segment guaranteed by the inner workings of Aligned_alloc_impl.
^ ^ | | | | | ptr returned by Aligned_alloc_impl
\ \ 0 \ \ alignof(max_align_t) - 1
VARLEN and ALIGNED-ALLOC-META are direct byproduct of Aligned_alloc_impl layout and guarantees.
VARLEN is the leftover variable-length segment that specialized implementations can further make use of by deducing its size from returned offset. Not used by this implementation.
ALIGNED-ALLOC-META is the segment which this abstraction is about. It can hold up to sizeof(META_1) + sizeof(META_2) bytes which is, due to Aligned_alloc_impl guarantees, at most alignof(max_align_t) bytes large. Providing larger data than supported is not possible and it is guarded through the means of static_assert. META_1 and META_2 fields can be arbitrarily sized meaning that they can even be of different sizes each.
DATA is an actual segment which will keep the user data.
using ut::detail::Aligned_alloc_metadata< Meta_1_type, Meta_2_type >::meta_1_t = Meta_1_type |
Convenience types that we will be using to serialize necessary details into the metadata segment.
using ut::detail::Aligned_alloc_metadata< Meta_1_type, Meta_2_type >::meta_2_t = Meta_2_type |
using ut::detail::Aligned_alloc_metadata< Meta_1_type, Meta_2_type >::unaligned_meta_2_t = meta_2_t |
|
inlinestaticnoexcept |
Helper function which recovers the information user previously stored in META_1 field.
|
inlinestaticnoexcept |
Bail out if we cannot fit the requested data size.
Helper function which stores user-provided detail into the META_1 field.
|
inlinestaticnoexcept |
Helper function which recovers the information user previously stored in META_2 field.
|
inlinestaticnoexcept |
Helper function which stores user-provided detail into the META_2 field.
|
inlinestaticprivatenoexcept |
Helper accessor function to metadata (offset).
|
inlinestaticprivatenoexcept |
Helper accessor function to metadata (data length).
|
staticconstexpr |
Metadata size.
|
staticconstexpr |
Max metadata size.