kern: update Initialize0 for new changes

This commit is contained in:
Michael Scire 2021-04-07 11:25:49 -07:00 committed by SciresM
parent 504472af4e
commit a1e137cc1c
5 changed files with 147 additions and 60 deletions

View file

@ -43,6 +43,11 @@ namespace ams::util {
return (value & invmask) == 0;
}
template<typename T> requires std::unsigned_integral<T>
constexpr ALWAYS_INLINE T GetAlignment(T value) {
return value & -value;
}
template<>
constexpr ALWAYS_INLINE void *AlignUp<void *>(void *value, size_t alignment) {
return reinterpret_cast<void *>(AlignUp(reinterpret_cast<uintptr_t>(value), alignment));