MySQL 9.1.0
Source Code Documentation
my_pointer_arithmetic.h File Reference

Some macros for dealing with pointer arithmetic, e.g., aligning of buffers to a given size. More...

#include <stdint.h>

Go to the source code of this file.

Macros

#define MY_ALIGN(A, L)   (((A) + (L)-1) & ~((L)-1))
 
#define ALIGN_SIZE(A)   MY_ALIGN((A), sizeof(double))
 

Functions

template<typename T >
bool is_aligned_to (T *t, int increment)
 
template<typename T >
bool is_aligned (T *t)
 

Detailed Description

Some macros for dealing with pointer arithmetic, e.g., aligning of buffers to a given size.

Macro Definition Documentation

◆ ALIGN_SIZE

#define ALIGN_SIZE (   A)    MY_ALIGN((A), sizeof(double))

◆ MY_ALIGN

#define MY_ALIGN (   A,
  L 
)    (((A) + (L)-1) & ~((L)-1))

Function Documentation

◆ is_aligned()

template<typename T >
bool is_aligned ( T *  t)

◆ is_aligned_to()

template<typename T >
bool is_aligned_to ( T *  t,
int  increment 
)