Realigns a pointer under a given power-of-2 alignment constraint.
Realigns a pointer over a given power-of-2 alignment constraint.
Realigns integral value under a given power-of-2 alignment constraint.
EVE provides various elements to simplify the management of SIMD-compatible memory like functions and allocators for requesting SIMD-compatible block of memory, pointer wrappers to discriminate aligned memory from regular one, and alignment computation functions.
Convenience header:
#include <eve/memory.hpp>
- Parameters
-
| v | Integral value to realign |
| alignment | Alignment constraint to apply. Behavior is undefined if this constraint is not a power of 2. |
- Returns
- An integer value greater or equal to
v which is a multiple of alignment
- See also
- align(T v, under alignment)
-
align(T* v, over alignment)
-
align(T* v, under alignment)
- Parameters
-
| v | Integral value to realign |
| alignment | Alignment constraint to apply. Behavior is undefined if this constraint is not a power of 2. |
- Returns
- An integer value lesser or equal to
v which is a multiple of alignment
- See also
- align(T v, over alignment)
-
align(T* v, over alignment)
-
align(T* v, under alignment)
- Parameters
-
| ptr | Pointer to realign |
| alignment | Alignment constraint to apply. Behavior is undefined if this constraint is not a power of 2. |
- Returns
- A pointer to
T which address is greater or equal to ptr and which value is a multiple of alignment.
- See also
- align(T v, over alignment)
-
align(T v, under alignment)
-
align(T* v, under alignment)
- Parameters
-
| ptr | Pointer to realign |
| alignment | Alignment constraint to apply. Behavior is undefined if this constraint is not a power of 2. |
- Returns
- A pointer to
T which address is lesser or equal to ptr and which value is a multiple of alignment.
- See also
- align(T v, over alignment)
-
align(T v, under alignment)
-
align(T* v, over alignment)
|
| enum class | eve::over : std::size_t |
| | Strong integral type that represents the notion of over-alignment constraints. More...
|
| |
| enum class | eve::under : std::size_t |
| | Strong integral type that represents the notion of under-alignment constraints. More...
|
| |