Move WriteBytes to AMemory, implement it with a Marshal copy like ReadBytes, fix regression on address range checking
This commit is contained in:
parent
91420a402c
commit
7f5a8effbb
15 changed files with 73 additions and 77 deletions
|
@ -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>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue