Class MemoryPatchFragment
- Namespace
- CStructSharp.Memory
- Assembly
- CStructSharp.dll
One physical piece of a patch: a final-source range, the bytes expected there, the bytes to write, and the generation seen while planning.
public sealed class MemoryPatchFragment
- Inheritance
-
MemoryPatchFragment
- Inherited Members
Remarks
A logical field that crosses a mapping boundary becomes several fragments, one per backing range, while the parent MemoryPatch keeps the logical selection. Expected and Generation let commit detect that the image changed since planning; Replacement is the proposed content. The public byte properties return copies so a preview user interface cannot alter a prepared write by editing an array it was shown. These checks are repeated at commit, but they cannot prevent a mutation that happens after validation on a source without external synchronization.
Properties
Expected
Gets a copy of the bytes that must still be present at commit.
public byte[] Expected { get; }
Property Value
- byte[]
Generation
Gets the source generation observed while planning; zero means the source relies on external snapshot consistency.
public long Generation { get; }
Property Value
Region
Gets the final-source range this fragment writes.
public MemoryRegion Region { get; }
Property Value
Replacement
Gets a copy of the bytes to write.
public byte[] Replacement { get; }
Property Value
- byte[]