MySQL 8.0.29
Source Code Documentation
ut::Cacheline_padded< T > Struct Template Reference

A utility wrapper class, which adds padding at the end of the wrapped structure, so that the next object after it is guaranteed to be in the next cache line. More...

#include <ut0cpu_cache.h>

Inheritance diagram for ut::Cacheline_padded< T >:
[legend]

Public Member Functions

template<class... Args>
 Cacheline_padded (Args &&... args)
 

Public Attributes

char pad [INNODB_CACHE_LINE_SIZE]
 

Detailed Description

template<typename T>
struct ut::Cacheline_padded< T >

A utility wrapper class, which adds padding at the end of the wrapped structure, so that the next object after it is guaranteed to be in the next cache line.

This is to avoid false-sharing. Use this, as opposed to alignas(), to avoid problems with allocators which do not handle over-aligned types.

Constructor & Destructor Documentation

◆ Cacheline_padded()

template<typename T >
template<class... Args>
ut::Cacheline_padded< T >::Cacheline_padded ( Args &&...  args)
inline

Member Data Documentation

◆ pad

template<typename T >
char ut::Cacheline_padded< T >::pad[INNODB_CACHE_LINE_SIZE]

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