mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-11-16 12:17:26 +01:00
common: alignment: Add DivideUp utility method.
This commit is contained in:
1 parent
f8d8755776
commit
c5df99ea2f
1 file changed
+5
@@ -42,6 +42,11 @@ requires std::is_integral_v<T>[[nodiscard]] constexpr bool IsAligned(T value, si
|
||||
return (value & mask) == 0;
|
||||
}
|
||||
|
||||
template <typename T, typename U>
|
||||
requires std::is_integral_v<T>[[nodiscard]] constexpr T DivideUp(T x, U y) {
|
||||
return (x + (y - 1)) / y;
|
||||
}
|
||||
|
||||
template <typename T, size_t Align = 16>
|
||||
class AlignmentAllocator {
|
||||
public:
|
||||
|
||||
Reference in new issue
Block a user