Move WriteBytes to AMemory, implement it with a Marshal copy like ReadBytes, fix regression on address range checking

This commit is contained in:
gdkchan 2018-06-09 13:05:41 -03:00
parent 49b7864971
commit 10fd47e2ca
15 changed files with 73 additions and 77 deletions

View file

@ -22,14 +22,6 @@ namespace ChocolArm64.Memory
}
}
public static void WriteBytes(AMemory Memory, long Position, byte[] Data)
{
for (int Offs = 0; Offs < Data.Length; Offs++)
{
Memory.WriteByte(Position + Offs, Data[Offs]);
}
}
public unsafe static T Read<T>(AMemory Memory, long Position) where T : struct
{
long Size = Marshal.SizeOf<T>();