Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ public void SetCompressedStack(CompressedStack stack)
public static long VolatileRead(ref long address) => Volatile.Read(ref address);
[Obsolete(Obsoletions.ThreadVolatileReadWriteMessage, DiagnosticId = Obsoletions.ThreadVolatileReadWriteDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
[EditorBrowsable(EditorBrowsableState.Never)]
public static IntPtr VolatileRead(ref IntPtr address) => Volatile.Read(ref address);
public static nint VolatileRead(ref nint address) => Volatile.Read(ref address);
[Obsolete(Obsoletions.ThreadVolatileReadWriteMessage, DiagnosticId = Obsoletions.ThreadVolatileReadWriteDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
[EditorBrowsable(EditorBrowsableState.Never)]
[return: NotNullIfNotNull(nameof(address))]
Expand All @@ -613,7 +613,7 @@ public void SetCompressedStack(CompressedStack stack)
[Obsolete(Obsoletions.ThreadVolatileReadWriteMessage, DiagnosticId = Obsoletions.ThreadVolatileReadWriteDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
[EditorBrowsable(EditorBrowsableState.Never)]
[CLSCompliant(false)]
public static UIntPtr VolatileRead(ref UIntPtr address) => Volatile.Read(ref address);
public static nuint VolatileRead(ref nuint address) => Volatile.Read(ref address);
[Obsolete(Obsoletions.ThreadVolatileReadWriteMessage, DiagnosticId = Obsoletions.ThreadVolatileReadWriteDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
[EditorBrowsable(EditorBrowsableState.Never)]
public static void VolatileWrite(ref byte address, byte value) => Volatile.Write(ref address, value);
Expand All @@ -631,7 +631,7 @@ public void SetCompressedStack(CompressedStack stack)
public static void VolatileWrite(ref long address, long value) => Volatile.Write(ref address, value);
[Obsolete(Obsoletions.ThreadVolatileReadWriteMessage, DiagnosticId = Obsoletions.ThreadVolatileReadWriteDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
[EditorBrowsable(EditorBrowsableState.Never)]
public static void VolatileWrite(ref IntPtr address, IntPtr value) => Volatile.Write(ref address, value);
public static void VolatileWrite(ref nint address, nint value) => Volatile.Write(ref address, value);
[Obsolete(Obsoletions.ThreadVolatileReadWriteMessage, DiagnosticId = Obsoletions.ThreadVolatileReadWriteDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
[EditorBrowsable(EditorBrowsableState.Never)]
public static void VolatileWrite([NotNullIfNotNull(nameof(value))] ref object? address, object? value) => Volatile.Write(ref address, value);
Expand All @@ -657,7 +657,7 @@ public void SetCompressedStack(CompressedStack stack)
[Obsolete(Obsoletions.ThreadVolatileReadWriteMessage, DiagnosticId = Obsoletions.ThreadVolatileReadWriteDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
[EditorBrowsable(EditorBrowsableState.Never)]
[CLSCompliant(false)]
public static void VolatileWrite(ref UIntPtr address, UIntPtr value) => Volatile.Write(ref address, value);
public static void VolatileWrite(ref nuint address, nuint value) => Volatile.Write(ref address, value);

/// <summary>
/// Manages functionality required to support members of <see cref="Thread"/> dealing with thread-local data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ public static void Write(ref long location, long value) =>
#endregion

#region IntPtr
private struct VolatileIntPtr { public volatile IntPtr Value; }
private struct VolatileIntPtr { public volatile nint Value; }

[Intrinsic]
[NonVersionable]
public static IntPtr Read(ref readonly IntPtr location) =>
Unsafe.As<IntPtr, VolatileIntPtr>(ref Unsafe.AsRef(in location)).Value;
public static nint Read(ref readonly nint location) =>
Unsafe.As<nint, VolatileIntPtr>(ref Unsafe.AsRef(in location)).Value;

[Intrinsic]
[NonVersionable]
public static void Write(ref IntPtr location, IntPtr value) =>
Unsafe.As<IntPtr, VolatileIntPtr>(ref location).Value = value;
public static void Write(ref nint location, nint value) =>
Unsafe.As<nint, VolatileIntPtr>(ref location).Value = value;
#endregion

#region SByte
Expand Down Expand Up @@ -197,19 +197,19 @@ public static void Write(ref ulong location, ulong value) =>
#endregion

#region UIntPtr
private struct VolatileUIntPtr { public volatile UIntPtr Value; }
private struct VolatileUIntPtr { public volatile nuint Value; }

[CLSCompliant(false)]
[Intrinsic]
[NonVersionable]
public static UIntPtr Read(ref readonly UIntPtr location) =>
Unsafe.As<UIntPtr, VolatileUIntPtr>(ref Unsafe.AsRef(in location)).Value;
public static nuint Read(ref readonly nuint location) =>
Unsafe.As<nuint, VolatileUIntPtr>(ref Unsafe.AsRef(in location)).Value;

[CLSCompliant(false)]
[Intrinsic]
[NonVersionable]
public static void Write(ref UIntPtr location, UIntPtr value) =>
Unsafe.As<UIntPtr, VolatileUIntPtr>(ref location).Value = value;
public static void Write(ref nuint location, nuint value) =>
Unsafe.As<nuint, VolatileUIntPtr>(ref location).Value = value;
#endregion

#region T
Expand Down
Loading