summaryrefslogtreecommitdiff
path: root/src/common/alignment.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/alignment.h')
-rw-r--r--src/common/alignment.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/alignment.h b/src/common/alignment.h
index fb81f10d8..32d796ffa 100644
--- a/src/common/alignment.h
+++ b/src/common/alignment.h
@@ -42,6 +42,11 @@ requires std::is_integral_v<T>[[nodiscard]] constexpr bool IsAligned(T value, si
42 return (value & mask) == 0; 42 return (value & mask) == 0;
43} 43}
44 44
45template <typename T, typename U>
46requires std::is_integral_v<T>[[nodiscard]] constexpr T DivideUp(T x, U y) {
47 return (x + (y - 1)) / y;
48}
49
45template <typename T, size_t Align = 16> 50template <typename T, size_t Align = 16>
46class AlignmentAllocator { 51class AlignmentAllocator {
47public: 52public: