From 77d76ed05aa2432185fdb803b2e3a3594b868e4b Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sun, 16 Oct 2022 17:53:52 +0100 Subject: [PATCH] Batch contiguous GMMU ranges into one --- app/src/main/cpp/skyline/common/address_space.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/cpp/skyline/common/address_space.inc b/app/src/main/cpp/skyline/common/address_space.inc index 3b161f10..6a637e12 100644 --- a/app/src/main/cpp/skyline/common/address_space.inc +++ b/app/src/main/cpp/skyline/common/address_space.inc @@ -253,7 +253,11 @@ namespace skyline { if (cpuAccessCallback) cpuAccessCallback(cpuBlock); - ranges.push_back(cpuBlock); + // Batch contiguous ranges into one + if (!ranges.empty() && ranges.back().data() + ranges.back().size() == cpuBlock.data()) + ranges.back() = {ranges.back().data(), ranges.back().size() + cpuBlock.size()}; + else + ranges.push_back(cpuBlock); } else { ranges.push_back(span{static_cast(nullptr), blockSize}); }