MySQL  8.0.28
Source Code Documentation
file::Block Struct Reference

Blocks for doing IO, used in the transparent compression and encryption code. More...

#include <os0file.h>

Public Member Functions

 Block () noexcept
 Default constructor. More...
 

Static Public Member Functions

static void free (file::Block *obj) noexcept
 Free the given memory block. More...
 

Public Attributes

bytem_ptr
 Pointer to the memory block. More...
 
size_t m_size
 Size of the data in memory block. More...
 
byte pad [ut::INNODB_CACHE_LINE_SIZE]
 This padding is needed to avoid false sharing. More...
 
std::atomic< bool > m_in_use
 

Detailed Description

Blocks for doing IO, used in the transparent compression and encryption code.

Constructor & Destructor Documentation

◆ Block()

file::Block::Block ( )
inlinenoexcept

Default constructor.

Member Function Documentation

◆ free()

void file::Block::free ( file::Block obj)
inlinestaticnoexcept

Free the given memory block.

Parameters
[in]objthe memory block to be freed.

Member Data Documentation

◆ m_in_use

std::atomic<bool> file::Block::m_in_use

◆ m_ptr

byte* file::Block::m_ptr

Pointer to the memory block.

◆ m_size

size_t file::Block::m_size

Size of the data in memory block.

This may be not UNIV_PAGE_SIZE if the data was compressed before encryption.

◆ pad

byte file::Block::pad[ut::INNODB_CACHE_LINE_SIZE]

This padding is needed to avoid false sharing.

TBD: of what exactly? We can't use alignas because std::vector<Block> uses std::allocator which in C++14 doesn't have to handle overaligned types. (see 20.7.9.1.5 of N4140 draft)


The documentation for this struct was generated from the following file: