mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
common: alignment: Add DivideUp utility method.
This commit is contained in:
parent
0d62f30b00
commit
b5b92fd1e5
1 changed files with 5 additions and 0 deletions
|
@ -42,6 +42,11 @@ requires std::is_integral_v<T>[[nodiscard]] constexpr bool IsAligned(T value, si
|
||||||
return (value & mask) == 0;
|
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>
|
template <typename T, size_t Align = 16>
|
||||||
class AlignmentAllocator {
|
class AlignmentAllocator {
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in a new issue