From 85c4e3b2eb6ff6ed31058b8ca3332d019b2f94ed Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Tue, 5 Aug 2025 06:31:24 -0700 Subject: [PATCH 1/6] respond to feedback (#11649) --- snippets/csharp/System/String/IndexOfAny/IndexOfAny1.cs | 9 ++++++--- snippets/csharp/System/String/IndexOfAny/ixany2.cs | 6 ++++-- snippets/csharp/System/String/IndexOfAny/ixany3.cs | 6 ++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/snippets/csharp/System/String/IndexOfAny/IndexOfAny1.cs b/snippets/csharp/System/String/IndexOfAny/IndexOfAny1.cs index bd5da47b4d8..7e46888284c 100644 --- a/snippets/csharp/System/String/IndexOfAny/IndexOfAny1.cs +++ b/snippets/csharp/System/String/IndexOfAny/IndexOfAny1.cs @@ -8,12 +8,15 @@ public static void Run() char[] chars = { 'a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y' }; String s = "The long and winding road..."; - Console.WriteLine($"The first vowel in \n {s}\n" + - $"is found at index {s.IndexOfAny(chars)}"); + Console.WriteLine($""" + The first vowel in + '{s}' + is found at index {s.IndexOfAny(chars)} + """); // The example displays the following output: // The first vowel in - // The long and winding road... + // 'The long and winding road...' // is found at index 2 // } diff --git a/snippets/csharp/System/String/IndexOfAny/ixany2.cs b/snippets/csharp/System/String/IndexOfAny/ixany2.cs index 4bd096b2703..f609c99f66d 100644 --- a/snippets/csharp/System/String/IndexOfAny/ixany2.cs +++ b/snippets/csharp/System/String/IndexOfAny/ixany2.cs @@ -22,8 +22,10 @@ public static void Run() Console.WriteLine(); Console.WriteLine("The first character occurrence " + $"from position {start} to {str.Length - 1}:"); - Console.WriteLine($"{Environment.NewLine}{br1}{Environment.NewLine}" + - $"{br2}{Environment.NewLine}{str}{Environment.NewLine}"); + Console.WriteLine($""" + {Environment.NewLine}{br1}{Environment.NewLine} + {br2}{Environment.NewLine}{str}{Environment.NewLine} + """); Console.Write($"A character in '{target}' occurs at position: "); at = str.IndexOfAny(anyOf, start); diff --git a/snippets/csharp/System/String/IndexOfAny/ixany3.cs b/snippets/csharp/System/String/IndexOfAny/ixany3.cs index cd33a33b681..2ad0da779a2 100644 --- a/snippets/csharp/System/String/IndexOfAny/ixany3.cs +++ b/snippets/csharp/System/String/IndexOfAny/ixany3.cs @@ -21,8 +21,10 @@ public static void Run() Console.WriteLine(); Console.WriteLine("The first character occurrence from " + $"position {start} for {count} characters:"); - Console.WriteLine($"{Environment.NewLine}{br1}{Environment.NewLine}{br2}" + - $"{Environment.NewLine}{str}{Environment.NewLine}"); + Console.WriteLine($""" + {Environment.NewLine}{br1}{Environment.NewLine}{br2} + {Environment.NewLine}{str}{Environment.NewLine} + """); Console.Write($"A character in '{target}' occurs at position: "); int at = str.IndexOfAny(anyOf, start, count); From 369ed46b4e28b0d0b7615526800933fe87aa1215 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Tue, 5 Aug 2025 15:39:26 +0100 Subject: [PATCH 2/6] Use `nint` for native-sized integers in `Marshal` (#11652) Related: https://github.com/dotnet/runtime/pull/118335 --- xml/System.Runtime.InteropServices/Marshal.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xml/System.Runtime.InteropServices/Marshal.xml b/xml/System.Runtime.InteropServices/Marshal.xml index 67b96040f26..cb56bedd4dd 100644 --- a/xml/System.Runtime.InteropServices/Marshal.xml +++ b/xml/System.Runtime.InteropServices/Marshal.xml @@ -329,7 +329,7 @@ - + @@ -9249,7 +9249,7 @@ On .NET 6 and later versions, this method is functionally equivalent to - + @@ -9337,7 +9337,7 @@ On .NET 6 and later versions, this method is functionally equivalent to - + @@ -9419,7 +9419,7 @@ On .NET 6 and later versions, this method is functionally equivalent to - + @@ -9575,7 +9575,7 @@ On .NET 6 and later versions, this method is functionally equivalent to - + @@ -13233,7 +13233,7 @@ public static void ThrowExceptionForHR(interrorCode,IntPtrerrorInfo) - + @@ -13318,7 +13318,7 @@ public static void ThrowExceptionForHR(interrorCode,IntPtrerrorInfo) - + @@ -13399,7 +13399,7 @@ public static void ThrowExceptionForHR(interrorCode,IntPtrerrorInfo) - + From 40337d2c9dc288d8a4242a5d2fa05dcc860e0052 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Tue, 5 Aug 2025 11:50:46 -0700 Subject: [PATCH 3/6] Add more area labels (#11647) --- .github/policies/label-issues.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/policies/label-issues.yml b/.github/policies/label-issues.yml index c08e446f49a..702e059090f 100644 --- a/.github/policies/label-issues.yml +++ b/.github/policies/label-issues.yml @@ -46,6 +46,8 @@ configuration: label: 'area-Extensions-Options' - labelAdded: label: 'area-Extensions-Primitives' + - labelAdded: + label: 'area-Infrastructure' - labelAdded: label: 'area-System.Buffers' - labelAdded: @@ -120,6 +122,8 @@ configuration: label: 'area-System.Resources' - labelAdded: label: 'area-System.Runtime' + - labelAdded: + label: 'area-System.Runtime.InteropServices' - labelAdded: label: 'area-System.Security' - labelAdded: From bb38067be6305506643c60178d93902deb7ce654 Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Tue, 5 Aug 2025 21:47:48 +0100 Subject: [PATCH 4/6] Replace `native sized` -> `native-sized` (#11655) --- xml/System.Runtime.InteropServices/CLong.xml | 2 +- xml/System.Runtime.InteropServices/CULong.xml | 2 +- xml/System.Runtime.InteropServices/Marshal.xml | 10 +++++----- xml/System/Math.xml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xml/System.Runtime.InteropServices/CLong.xml b/xml/System.Runtime.InteropServices/CLong.xml index 9d3205145a9..7800452aa35 100644 --- a/xml/System.Runtime.InteropServices/CLong.xml +++ b/xml/System.Runtime.InteropServices/CLong.xml @@ -94,7 +94,7 @@ The integer value. - Constructs an instance from a native sized integer. + Constructs an instance from a native-sized integer. To be added. is outside the range of the underlying storage type. diff --git a/xml/System.Runtime.InteropServices/CULong.xml b/xml/System.Runtime.InteropServices/CULong.xml index 52bfd0d9553..51871844006 100644 --- a/xml/System.Runtime.InteropServices/CULong.xml +++ b/xml/System.Runtime.InteropServices/CULong.xml @@ -94,7 +94,7 @@ The integer value. - Constructs an instance from a native sized unsigned integer. + Constructs an instance from a native-sized unsigned integer. To be added. is outside the range of the underlying storage type. diff --git a/xml/System.Runtime.InteropServices/Marshal.xml b/xml/System.Runtime.InteropServices/Marshal.xml index cb56bedd4dd..bfeca48a1d0 100644 --- a/xml/System.Runtime.InteropServices/Marshal.xml +++ b/xml/System.Runtime.InteropServices/Marshal.xml @@ -9245,7 +9245,7 @@ On .NET 6 and later versions, this method is functionally equivalent to 4.2.0.0 - Reads a processor native sized integer from unmanaged memory. Reading from unaligned memory locations is supported. + Reads a processor native-sized integer from unmanaged memory. Reading from unaligned memory locations is supported. @@ -9393,7 +9393,7 @@ On .NET 6 and later versions, this method is functionally equivalent to The base address in unmanaged memory from which to read. An additional byte offset, which is added to the parameter before reading. - Reads a processor native sized integer at a given offset from unmanaged memory. + Reads a processor native-sized integer at a given offset from unmanaged memory. The integer read from unmanaged memory at the given offset. The base address in unmanaged memory of the source object. An additional byte offset, which is added to the parameter before reading. - Reads a processor native sized integer from unmanaged memory. + Reads a processor native-sized integer from unmanaged memory. The integer read from unmanaged memory at the given offset. The address in unmanaged memory to write to. The value to write. - Writes a processor native sized integer value into unmanaged memory. + Writes a processor native-sized integer value into unmanaged memory. The base address in unmanaged memory of the target object. An additional byte offset, which is added to the parameter before writing. The value to write. - Writes a processor native sized integer value to unmanaged memory. + Writes a processor native-sized integer value to unmanaged memory. A signed number. - Returns an integer that indicates the sign of a native sized signed integer. + Returns an integer that indicates the sign of a native-sized signed integer. A number that indicates the sign of , as shown in the following table. Return value From 27aa219f1d0c481a2c4d7326e4d8054222bf475c Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Tue, 5 Aug 2025 21:48:25 +0100 Subject: [PATCH 5/6] Revert "Use `nint` for native-sized integers in `Marshal` (#11652)" (#11657) This reverts commit 369ed46b4e28b0d0b7615526800933fe87aa1215. --- xml/System.Runtime.InteropServices/Marshal.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xml/System.Runtime.InteropServices/Marshal.xml b/xml/System.Runtime.InteropServices/Marshal.xml index bfeca48a1d0..8210b886f60 100644 --- a/xml/System.Runtime.InteropServices/Marshal.xml +++ b/xml/System.Runtime.InteropServices/Marshal.xml @@ -329,7 +329,7 @@ - + @@ -9249,7 +9249,7 @@ On .NET 6 and later versions, this method is functionally equivalent to - + @@ -9337,7 +9337,7 @@ On .NET 6 and later versions, this method is functionally equivalent to - + @@ -9419,7 +9419,7 @@ On .NET 6 and later versions, this method is functionally equivalent to - + @@ -9575,7 +9575,7 @@ On .NET 6 and later versions, this method is functionally equivalent to - + @@ -13233,7 +13233,7 @@ public static void ThrowExceptionForHR(interrorCode,IntPtrerrorInfo) - + @@ -13318,7 +13318,7 @@ public static void ThrowExceptionForHR(interrorCode,IntPtrerrorInfo) - + @@ -13399,7 +13399,7 @@ public static void ThrowExceptionForHR(interrorCode,IntPtrerrorInfo) - + From b314392d22b44ed9a5143a6984bc15636b096ea0 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 5 Aug 2025 16:15:12 -0700 Subject: [PATCH 6/6] Add documentation warning for Interlocked.Read write access requirement on 32-bit platforms (#11659) Fixes #11658 Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com> --- xml/System.Threading/Interlocked.xml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/xml/System.Threading/Interlocked.xml b/xml/System.Threading/Interlocked.xml index 9c97cae3482..564e4065953 100644 --- a/xml/System.Threading/Interlocked.xml +++ b/xml/System.Threading/Interlocked.xml @@ -2950,6 +2950,9 @@ This method wraps a call to [FlushProcessWriteBuffers](/windows/win32/api/proces ## Remarks The method is unnecessary on 64-bit systems, because 64-bit read operations are already atomic. On 32-bit systems, 64-bit read operations are not atomic unless performed using . +> [!IMPORTANT] +> On 32-bit platforms, despite taking a readonly reference parameter, this method requires write access to the memory location because it uses internally to ensure atomicity. Attempting to read from read-only memory (such as memory-mapped files opened with read-only access) can result in an . + ]]> @@ -3006,7 +3009,17 @@ This method wraps a call to [FlushProcessWriteBuffers](/windows/win32/api/proces The 64-bit value to be loaded. Returns a 64-bit unsigned value, loaded as an atomic operation. The loaded value. - To be added. + + method is unnecessary on 64-bit systems, because 64-bit read operations are already atomic. On 32-bit systems, 64-bit read operations are not atomic unless performed using . + +> [!IMPORTANT] +> On 32-bit platforms, despite taking a readonly reference parameter, this method requires write access to the memory location because it uses internally to ensure atomicity. Attempting to read from read-only memory (such as memory-mapped files opened with read-only access) can result in an . + + ]]> +