Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
util
Misalignment.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_UTIL_MISALIGNMENT_H_
36
#define _BLAZE_UTIL_MISALIGNMENT_H_
37
38
39
//*************************************************************************************************
40
// Includes
41
//*************************************************************************************************
42
43
#include <
blaze/system/Inline.h
>
44
#include <
blaze/util/Types.h
>
45
#include <
blaze/util/typetraits/AlignmentOf.h
>
46
47
48
namespace
blaze {
49
50
//=================================================================================================
51
//
52
// SIZETRAIT CLASS DEFINITION
53
//
54
//=================================================================================================
55
56
//*************************************************************************************************
67
template
<
typename
T >
68
BLAZE_ALWAYS_INLINE
size_t
misalignment
(
const
T* address )
69
{
70
return
(
reinterpret_cast<
size_t
>
( address ) %
AlignmentOf_v<T>
);
71
}
72
//*************************************************************************************************
73
74
}
// namespace blaze
75
76
#endif
AlignmentOf.h
Header file for the AlignmentOf type trait.
BLAZE_ALWAYS_INLINE
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition
Inline.h:85
blaze::AlignmentOf_v
constexpr size_t AlignmentOf_v
Auxiliary variable template for the AlignmentOf type trait.
Definition
AlignmentOf.h:239
blaze::misalignment
BLAZE_ALWAYS_INLINE size_t misalignment(const T *address)
Computes the misalignment of the given address.
Definition
Misalignment.h:68
Inline.h
System settings for the inline keywords.
Types.h
Header file for basic type definitions.
Generated by
1.18.0