summaryrefslogtreecommitdiffstats
path: root/src/common/alignment.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-02-27 20:48:35 +0100
committerGitHub <noreply@github.com>2021-02-27 20:48:35 +0100
commit09f7c355c6d7e3c7845ba96d9704489d2d5853f4 (patch)
treeb12127263c0e4999f0a6e9edfe7f8f25adef9d37 /src/common/alignment.h
parentMerge pull request #5944 from Morph1984/gc-vibrations (diff)
parenthle: kernel: Migrate PageHeap/PageTable to KPageHeap/KPageTable. (diff)
downloadyuzu-09f7c355c6d7e3c7845ba96d9704489d2d5853f4.tar
yuzu-09f7c355c6d7e3c7845ba96d9704489d2d5853f4.tar.gz
yuzu-09f7c355c6d7e3c7845ba96d9704489d2d5853f4.tar.bz2
yuzu-09f7c355c6d7e3c7845ba96d9704489d2d5853f4.tar.lz
yuzu-09f7c355c6d7e3c7845ba96d9704489d2d5853f4.tar.xz
yuzu-09f7c355c6d7e3c7845ba96d9704489d2d5853f4.tar.zst
yuzu-09f7c355c6d7e3c7845ba96d9704489d2d5853f4.zip
Diffstat (limited to '')
-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
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: