summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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) {
return (value & 0xFFF) == 0;
}
+template <typename T>
+constexpr bool IsWordAligned(T value) {
+ static_assert(std::is_unsigned_v<T>, "T must be an unsigned value.");
+ return (value & 0b11) == 0;
+}
+
} // namespace Common