PPTC meets ExeFS Patching. (#1865)
* PPTC meets ExeFS Patching. * InternalVersion = 1865 * Ready! * Optimized the PtcProfiler Load/Save methods.
This commit is contained in:
parent
a8022ca3a1
commit
57ea3f93a3
7 changed files with 190 additions and 166 deletions
|
@ -50,7 +50,12 @@ namespace ARMeilleure.Translation.PTC
|
|||
T structure = default(T);
|
||||
|
||||
Span<T> spanT = MemoryMarshal.CreateSpan(ref structure, 1);
|
||||
stream.Read(MemoryMarshal.AsBytes(spanT));
|
||||
int bytesCount = stream.Read(MemoryMarshal.AsBytes(spanT));
|
||||
|
||||
if (bytesCount != Unsafe.SizeOf<T>())
|
||||
{
|
||||
throw new EndOfStreamException();
|
||||
}
|
||||
|
||||
return structure;
|
||||
}
|
||||
|
@ -130,7 +135,12 @@ namespace ARMeilleure.Translation.PTC
|
|||
|
||||
T[] item = new T[itemLength];
|
||||
|
||||
stream.Read(MemoryMarshal.AsBytes(item.AsSpan()));
|
||||
int bytesCount = stream.Read(MemoryMarshal.AsBytes(item.AsSpan()));
|
||||
|
||||
if (bytesCount != itemLength)
|
||||
{
|
||||
throw new EndOfStreamException();
|
||||
}
|
||||
|
||||
list.Add(item);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue