summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/alignment.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/alignment.h b/src/common/alignment.h
index b3f103c07..d94a2291f 100644
--- a/src/common/alignment.h
+++ b/src/common/alignment.h
@@ -25,4 +25,10 @@ constexpr bool Is4KBAligned(T value) {
25 return (value & 0xFFF) == 0; 25 return (value & 0xFFF) == 0;
26} 26}
27 27
28template <typename T>
29constexpr bool IsWordAligned(T value) {
30 static_assert(std::is_unsigned_v<T>, "T must be an unsigned value.");
31 return (value & 0b11) == 0;
32}
33
28} // namespace Common 34} // namespace Common