You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 24, 2026. It is now read-only.
Enable nullable reference types and update nullability; fix several null checks
Fully enable nullable reference types and update method signatures, fields, and events to use nullable annotations throughout the codebase. Methods now return null instead of empty arrays/strings where appropriate. Private parameterless constructors now throw NotImplementedException to prevent misuse. Improves null-safety, code clarity, and robustness against null reference exceptions.
/// <param name="pa">Physical address to read from.</param>
194
195
/// <param name="cb">Count of bytes to read.</param>
195
196
/// <returns>A byte array with the read memory, otherwise <see langword="null"/>.</returns>
196
-
publicunsafebyte[]Read(ulongpa,uintcb)
197
+
publicunsafebyte[]?Read(ulongpa,uintcb)
197
198
{
198
199
vararr=newbyte[cb];
199
200
fixed (byte*pb=arr)
@@ -235,7 +236,7 @@ public unsafe bool ReadValue<T>(ulong pa, out T result)
235
236
/// <param name="pa">Physical address to read.</param>
236
237
/// <param name="count">Number of elements to read.</param>
237
238
/// <returns>An array on success; otherwise <see langword="null"/>.</returns>
238
-
publicunsafeT[]ReadArray<T>(ulongpa,intcount)
239
+
publicunsafeT[]?ReadArray<T>(ulongpa,intcount)
239
240
whereT: unmanaged
240
241
{
241
242
vararr=newT[count];
@@ -257,7 +258,7 @@ public unsafe T[] ReadArray<T>(ulong pa, int count)
257
258
/// <param name="pa">Physical address to read.</param>
258
259
/// <param name="count">Number of elements to read.</param>
259
260
/// <returns>A <see cref="IMemoryOwner{T}"/> lease on success; otherwise <see langword="null"/>. Be sure to call <see cref="IDisposable.Dispose()"/> when done.</returns>
@@ -399,7 +399,7 @@ public unsafe T[] ReadArray<T>(ulong address, int count)
399
399
/// <param name="address">Address to read from.</param>
400
400
/// <param name="count">The number of array elements to read.</param>
401
401
/// <returns><see cref="IMemoryOwner{T}"/> lease, or <see langword="null"/> if failed. Be sure to call <see cref="IDisposable.Dispose()"/> when done.</returns>
0 commit comments