Correct type of executable sizes (#1802)

This commit is contained in:
gdkchan 2020-12-13 04:30:27 -03:00 committed by GitHub
parent ef157bbe26
commit 19d18662ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 95 additions and 77 deletions

View file

@ -13,6 +13,18 @@ namespace Ryujinx.Memory
void Write<T>(ulong va, T value) where T : unmanaged;
void Write(ulong va, ReadOnlySpan<byte> data);
void Fill(ulong va, ulong size, byte value)
{
const int MaxChunkSize = 1 << 30;
for (ulong subOffset = 0; subOffset < size; subOffset += MaxChunkSize)
{
int copySize = (int)Math.Min(MaxChunkSize, size - subOffset);
GetWritableRegion(va + subOffset, copySize).Memory.Span.Fill(0);
}
}
ReadOnlySpan<byte> GetSpan(ulong va, int size, bool tracked = false);
WritableRegion GetWritableRegion(ulong va, int size);
ref T GetRef<T>(ulong va) where T : unmanaged;