diff --git a/app/src/main/cpp/skyline/common/address_space.h b/app/src/main/cpp/skyline/common/address_space.h index e3f1965c..39cf2b39 100644 --- a/app/src/main/cpp/skyline/common/address_space.h +++ b/app/src/main/cpp/skyline/common/address_space.h @@ -3,6 +3,7 @@ #pragma once +#include #include #include @@ -10,6 +11,8 @@ namespace skyline { template concept AddressSpaceValid = std::is_unsigned_v && sizeof(VaType) * 8 >= AddressSpaceBits; + using TranslatedAddressRange = boost::container::small_vector, 1>; + struct EmptyStruct {}; /** @@ -116,7 +119,7 @@ namespace skyline { /** * @return A vector of all physical ranges inside of the given virtual range */ - std::vector> TranslateRange(VaType virt, VaType size, std::function)> cpuAccessCallback = {}); + TranslatedAddressRange TranslateRange(VaType virt, VaType size, std::function)> cpuAccessCallback = {}); void Read(u8 *destination, VaType virt, VaType size, std::function)> cpuAccessCallback = {}); diff --git a/app/src/main/cpp/skyline/common/address_space.inc b/app/src/main/cpp/skyline/common/address_space.inc index bec53a73..00607a04 100644 --- a/app/src/main/cpp/skyline/common/address_space.inc +++ b/app/src/main/cpp/skyline/common/address_space.inc @@ -233,7 +233,7 @@ namespace skyline { munmap(sparseMap, SparseMapSize); } - MM_MEMBER(std::vector>)::TranslateRange(VaType virt, VaType size, std::function)> cpuAccessCallback) { + MM_MEMBER(TranslatedAddressRange)::TranslateRange(VaType virt, VaType size, std::function)> cpuAccessCallback) { TRACE_EVENT("containers", "FlatMemoryManager::TranslateRange"); std::scoped_lock lock(this->blockMutex); @@ -247,7 +247,7 @@ namespace skyline { u8 *blockPhys{predecessor->phys + (virt - predecessor->virt)}; VaType blockSize{std::min(successor->virt - virt, size)}; - std::vector> ranges; + TranslatedAddressRange ranges; while (size) { // Return a zeroed out map to emulate sparse mappings