diff --git a/src/Ryujinx.Memory/Range/PagedMemoryRangeCoalescingEnumerator.cs b/src/Ryujinx.Memory/Range/PagedMemoryRangeCoalescingEnumerator.cs index c87e0fb687..232bfd8ea8 100644 --- a/src/Ryujinx.Memory/Range/PagedMemoryRangeCoalescingEnumerator.cs +++ b/src/Ryujinx.Memory/Range/PagedMemoryRangeCoalescingEnumerator.cs @@ -1,4 +1,5 @@ using System; +using System.Runtime.CompilerServices; namespace Ryujinx.Memory.Range { @@ -12,7 +13,11 @@ namespace Ryujinx.Memory.Range _enumerator = new PagedMemoryRangeEnumerator(startAddress, size, pageSize, mapAddress); } - public readonly MemoryRange Current => _current!.Value; + public readonly MemoryRange Current + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _current!.Value; + } /// /// Returning this through a GetEnumerator() call allows it to be used directly in a foreach loop. diff --git a/src/Ryujinx.Memory/Range/PagedMemoryRangeEnumerator.cs b/src/Ryujinx.Memory/Range/PagedMemoryRangeEnumerator.cs index 52d712dced..2c1b15df96 100644 --- a/src/Ryujinx.Memory/Range/PagedMemoryRangeEnumerator.cs +++ b/src/Ryujinx.Memory/Range/PagedMemoryRangeEnumerator.cs @@ -1,4 +1,5 @@ using System; +using System.Runtime.CompilerServices; namespace Ryujinx.Memory.Range { @@ -22,9 +23,17 @@ namespace Ryujinx.Memory.Range _offset = 0; } - public readonly MemoryRange Current => _current!.Value; + public readonly MemoryRange Current + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _current!.Value; + } - internal readonly bool HasCurrent => _current.HasValue; + internal readonly bool HasCurrent + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => _current.HasValue; + } /// /// Returning this through a GetEnumerator() call allows it to be used directly in a foreach loop. @@ -59,6 +68,7 @@ namespace Ryujinx.Memory.Range return false; } + [MethodImpl(MethodImplOptions.AggressiveInlining)] private void SetCurrent(ulong address, int size) { _current = new MemoryRange(address, (ulong)size);