Fix GetWritableRegion write-back (#2456)

This commit is contained in:
gdkchan 2021-07-10 16:50:10 -03:00 committed by GitHub
parent 59900d7f00
commit b1a9d17cf8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -66,7 +66,9 @@ namespace Ryujinx.Memory
{
int copySize = (int)Math.Min(MaxChunkSize, size - subOffset);
GetWritableRegion(va + subOffset, copySize).Memory.Span.Fill(0);
using var writableRegion = GetWritableRegion(va + subOffset, copySize);
writableRegion.Memory.Span.Fill(0);
}
}

View file

@ -333,7 +333,7 @@ namespace Ryujinx.Memory
/// <exception cref="InvalidMemoryRegionException">Throw when either <paramref name="offset"/> or <paramref name="size"/> are out of range</exception>
public WritableRegion GetWritableRegion(ulong offset, int size)
{
return new WritableRegion(this, offset, GetMemory(offset, size));
return new WritableRegion(null, offset, GetMemory(offset, size));
}
/// <summary>