diff options
| author | JosJuice <josjuice@gmail.com> | 2026-08-22 11:22:33 +0200 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2026-08-22 11:52:22 +0200 |
| commit | f93a8a995b6e16625c60303ccabb0ea71e7dbeb2 (patch) | |
| tree | c6303977d6dcd7538ac0eca1561cdb6b1b476b19 /Source/Core/Common/LazyMemoryRegionBitSet.cpp | |
| parent | 82f7ec53902d805a6f5091f913035f29499c873a (diff) | |
Common: Add DivideRoundingUp function
Many callers of AlignUp are dividing immediately after aligning. Let's
add a helper function for this so callers don't have to specify the
alignment size twice.
Diffstat (limited to 'Source/Core/Common/LazyMemoryRegionBitSet.cpp')
| -rw-r--r-- | Source/Core/Common/LazyMemoryRegionBitSet.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/Common/LazyMemoryRegionBitSet.cpp b/Source/Core/Common/LazyMemoryRegionBitSet.cpp index af9d79c8df..89f707daa0 100644 --- a/Source/Core/Common/LazyMemoryRegionBitSet.cpp +++ b/Source/Core/Common/LazyMemoryRegionBitSet.cpp @@ -58,7 +58,7 @@ void LazyMemoryRegionBitSet::SetBits(size_t bits_start, size_t bits_end) if (bits_start % 32 != 0) m_pointer[bits_start / 32] |= extra_first_word; - const size_t start_index = Common::AlignUp(bits_start, 32) / 32; + const size_t start_index = Common::DivideRoundingUp(bits_start, 32); const size_t end_index = bits_end / 32; std::memset(m_pointer + start_index, 0xFF, (end_index - start_index) * 4); @@ -85,7 +85,7 @@ void LazyMemoryRegionBitSet::ClearBits(size_t bits_start, size_t bits_end) if (bits_start % 32 != 0) m_pointer[bits_start / 32] &= extra_first_word; - const size_t start_index = Common::AlignUp(bits_start, 32) / 32; + const size_t start_index = Common::DivideRoundingUp(bits_start, 32); const size_t end_index = bits_end / 32; std::memset(m_pointer + start_index, 0x00, (end_index - start_index) * sizeof(u32)); |
