Kernel alignment handling (ALIGN in bytes, power of two; 0 - natural alignment of pointed type).
More...
#include <klib/kAlign.hpp>
|
template<igros_usize_t ALIGN = 0_usize, kalignable T>
requires (std::has_single_bit(ALIGN) || (0_usize == ALIGN)) |
| static constexpr auto | check (const T value) noexcept -> bool |
| | Check alignment.
|
template<igros_usize_t ALIGN = 0_usize, kalignable T>
requires (std::has_single_bit(ALIGN) || (0_usize == ALIGN)) |
| static constexpr auto | up (const T value) noexcept -> T |
| | Align up.
|
template<igros_usize_t ALIGN = 0_usize, kalignable T>
requires (std::has_single_bit(ALIGN) || (0_usize == ALIGN)) |
| static constexpr auto | down (const T value) noexcept -> T |
| | Align down.
|
Kernel alignment handling (ALIGN in bytes, power of two; 0 - natural alignment of pointed type).
Definition at line 40 of file kAlign.hpp.
◆ alignment()
|
|
staticnodiscardconstevalprivatenoexcept |
Alignment in bytes.
- Template Parameters
-
| ALIGN | Requested alignment in bytes (0 - natural alignment) |
| T | Aligned type |
- Returns
- Alignment in bytes (1 for integers without requested alignment)
Definition at line 111 of file kAlign.hpp.
◆ check()
template<
igros_usize_t ALIGN, kalignable T>
requires (std::has_single_bit(ALIGN) || (0_usize == ALIGN))
| auto igros::klib::kAlign::check |
( |
const T | value | ) |
->bool |
|
staticnodiscardconstexprnoexcept |
Check alignment.
- Template Parameters
-
| ALIGN | Alignment in bytes, power of two (0 - natural alignment of pointed type) |
| T | Integer or pointer type |
- Parameters
-
- Returns
- true if value is aligned
Definition at line 155 of file kAlign.hpp.
◆ down()
template<
igros_usize_t ALIGN, kalignable T>
requires (std::has_single_bit(ALIGN) || (0_usize == ALIGN))
| auto igros::klib::kAlign::down |
( |
const T | value | ) |
->T |
|
staticnodiscardconstexprnoexcept |
Align down.
- Template Parameters
-
| ALIGN | Alignment in bytes, power of two (0 - natural alignment of pointed type) |
| T | Integer or pointer type |
- Parameters
-
- Returns
- Largest aligned value not greater than value
Definition at line 172 of file kAlign.hpp.
◆ from()
template<kalignable T>
| auto igros::klib::kAlign::from |
( |
const kalign_int_t< T > | value | ) |
->T |
|
staticnodiscardconstexprprivatenoexcept |
Integer as value.
- Template Parameters
-
- Parameters
-
| value | Integer value (address for pointers) |
- Returns
- Value of type T
Definition at line 142 of file kAlign.hpp.
◆ integer()
template<kalignable T>
| auto igros::klib::kAlign::integer |
( |
const T | value | ) |
->kalign_int_t< T > |
|
staticnodiscardconstexprprivatenoexcept |
Value as integer.
- Template Parameters
-
- Parameters
-
- Returns
- Integer value (address for pointers)
Definition at line 131 of file kAlign.hpp.
◆ mask()
|
|
staticnodiscardconstevalprivatenoexcept |
Alignment mask.
- Template Parameters
-
| ALIGN | Requested alignment in bytes (0 - natural alignment) |
| T | Aligned type |
- Returns
- Mask of low bits that must be zero in aligned value
Definition at line 124 of file kAlign.hpp.
◆ up()
template<
igros_usize_t ALIGN, kalignable T>
requires (std::has_single_bit(ALIGN) || (0_usize == ALIGN))
| auto igros::klib::kAlign::up |
( |
const T | value | ) |
->T |
|
staticnodiscardconstexprnoexcept |
Align up.
- Template Parameters
-
| ALIGN | Alignment in bytes, power of two (0 - natural alignment of pointed type) |
| T | Integer or pointer type |
- Parameters
-
- Returns
- Smallest aligned value not less than value
Definition at line 163 of file kAlign.hpp.
The documentation for this class was generated from the following file: