Skip to content

Commit 6c4193e

Browse files
authored
Merge pull request #4154 from dotnet/publish-18218
Merge master into live
2 parents af73a25 + 176576c commit 6c4193e

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

xml/System.Threading.Tasks/Task.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2599,7 +2599,7 @@ Task t Status: RanToCompletion, Result: 42
25992599
<format type="text/markdown"><![CDATA[
26002600
26012601
## Remarks
2602-
Tasks that throw unhandled exceptions store the resulting exception and propagate it wrapped in a <xref:System.AggregateException> in calls to <xref:System.Threading.Tasks.Task.Wait%2A> or in accesses to the <xref:System.Threading.Tasks.Task.Exception%2A> property. Any exceptions not observed by the time the task instance is garbage collected will be propagated on the finalizer thread. For more information and an example, see [Exception Handling (Task Parallel Library)](~/docs/standard/parallel-programming/exception-handling-task-parallel-library.md).
2602+
Tasks that throw unhandled exceptions store the resulting exception and propagate it wrapped in a <xref:System.AggregateException> in calls to <xref:System.Threading.Tasks.Task.Wait%2A> or in accesses to the <xref:System.Threading.Tasks.Task.Exception%2A> property. On .NET Framework 4.0, any exceptions not observed by the time the task instance is garbage collected will be propagated on the finalizer thread, which crashes the process. On .NET Framework 4.5 and later the default behavior changed so unobserved exceptions are not rethrown from the Finalizer. .NET Core does not rethrow the exception on the Finalizer. For more information and an example, see [Exception Handling (Task Parallel Library)](~/docs/standard/parallel-programming/exception-handling-task-parallel-library.md).
26032603
26042604
]]></format>
26052605
</remarks>

xml/System/IAsyncDisposable.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The async methods are used in conjunction with the `async` and `await` keywords
3737
3838
### Using an object that implements IAsyncDisposable
3939
40-
If your application uses an object that implements `IAsyncDisposable`, you should call the object's <xref:System.IAsyncDisposable.DisposeAsync%2A> implementation when you are finished using it. To make sure resources are released even in case of an exception, call the <xref:System.IAsyncDisposable.DisposeAsync%2A> method inside a `finally` clause of the `try`/`finally` statement. For more information about the `try`/`finally` pattern, see [try-finally](~/docs/csharp/language-reference/keywords/try-finally.md) (C#) or [Try...Catch...Finally Statement](~/docs/visual-basic/language-reference/statements/try-catch-finally-statement.md) (Visual Basic).
40+
If your application uses an object that implements `IAsyncDisposable`, you should call the object's <xref:System.IAsyncDisposable.DisposeAsync%2A> implementation when you are finished using it. To make sure resources are released even in case of an exception, put the code that uses the `IAsyncDisposable` object into the [using](~/docs/csharp/language-reference/keywords/using.md) statement (in C# beginning from version 8.0) or call the <xref:System.IAsyncDisposable.DisposeAsync%2A> method inside a `finally` clause of the `try`/`finally` statement. For more information about the `try`/`finally` pattern, see [try-finally](~/docs/csharp/language-reference/keywords/try-finally.md) (C#) or [Try...Catch...Finally Statement](~/docs/visual-basic/language-reference/statements/try-catch-finally-statement.md) (Visual Basic).
4141
4242
### Implementing IAsyncDisposable
4343

xml/System/Memory`1.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
5353
## Remarks
5454
55-
Like <xref:System.Span%601>, `Memory<T>` represents a contiguous region of memory. Unlike <xref:System.Span%601>, however, `Memory<T>` is not a [ref struct](~/docs/csharp/language-reference/keywords/ref.md#ref-struct-types). This means that `Memory<T>` can be placed on the managed heap, whereas <xref:System.Span%601> cannot. As a result, the `Memory<T>` structure does not have the same restrictions as a <xref:System.Span%601> instance. In particular:
55+
Like <xref:System.Span%601>, `Memory<T>` represents a contiguous region of memory. Unlike <xref:System.Span%601>, however, `Memory<T>` is not a [ref struct](~/docs/csharp/language-reference/builtin-types/struct.md#ref-struct). This means that `Memory<T>` can be placed on the managed heap, whereas <xref:System.Span%601> cannot. As a result, the `Memory<T>` structure does not have the same restrictions as a <xref:System.Span%601> instance. In particular:
5656
5757
- It can be used as a field in a class.
5858

xml/System/ReadOnlySpan`1+Enumerator.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Though the <xref:System.ReadOnlySpan`1> is allocated on the stack, the underlyin
5252
5353
Unlike some other enumerator structures in .NET, the <xref:System.ReadOnlySpan`1.Enumerator>:
5454
55-
- Does not implement the <xref:System.Collections.IEnumerator> or <xref:System.Collections.Generic.IEnumerator`1> interface. This is because <xref:System.ReadOnlySpan`1.Enumerator> is a [ref struct](~/docs/csharp/language-reference/keywords/ref.md#ref-struct-types) and cannot be boxed.
55+
- Does not implement the <xref:System.Collections.IEnumerator> or <xref:System.Collections.Generic.IEnumerator`1> interface. This is because <xref:System.ReadOnlySpan`1.Enumerator> is a [ref struct](~/docs/csharp/language-reference/builtin-types/struct.md#ref-struct) and cannot be boxed.
5656
5757
- Does not include a `Reset` method, which can set the enumerator to its initial position before the first element in the span. (The <xref:System.Collections.IEnumerator.Reset?displayProperty=nameWithType> method must be implemented as part of the interface, but most implementors either throw an exception or provide no implementation.)
5858

xml/System/ReadOnlySpan`1.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<typeparam name="T">The type of items in the <see cref="T:System.ReadOnlySpan`1" />.</typeparam>
4545
<summary>Provides a type-safe and memory-safe read-only representation of a contiguous region of arbitrary memory.</summary>
4646
<remarks>
47-
<format type="text/markdown"><![CDATA[`ReadOnlySpan<T>` is a [ref struct](~/docs/csharp/language-reference/keywords/ref.md#ref-struct-types) that is allocated on the stack and can never escape to the managed heap. Ref struct types have a number of restrictions to ensure that they cannot be promoted to the managed heap, including that they can't be boxed, captured in lambda expressions, assigned to variables of type <xref:System.Object>, assigned to `dynamic` variables, and they cannot implement any interface type.
47+
<format type="text/markdown"><![CDATA[`ReadOnlySpan<T>` is a [ref struct](~/docs/csharp/language-reference/builtin-types/struct.md#ref-struct) that is allocated on the stack and can never escape to the managed heap. Ref struct types have a number of restrictions to ensure that they cannot be promoted to the managed heap, including that they can't be boxed, captured in lambda expressions, assigned to variables of type <xref:System.Object>, assigned to `dynamic` variables, and they cannot implement any interface type.
4848
4949
A `ReadOnlySpan<T>` instance is often used to reference the elements of an array or a portion of an array. Unlike an array, however, a `ReadOnlySpan<T>` instance can point to managed memory, native memory, or memory managed on the stack.]]></format>
5050
</remarks>

xml/System/Span`1.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<remarks>
4747
<format type="text/markdown"><![CDATA[
4848
49-
`Span<T>` is a [ref struct](~/docs/csharp/language-reference/keywords/ref.md#ref-struct-types) that is allocated on the stack rather than on the managed heap. Ref struct types have a number of restrictions to ensure that they cannot be promoted to the managed heap, including that they can't be boxed, they can't be assigned to variables of type <xref:System.Object>, `dynamic` or to any interface type, they can't be fields in a reference type, and they can't be used across `await` and `yield` boundaries. In addition, calls to two methods, <xref:System.Span%601.Equals(System.Object)> and <xref:System.Span%601.GetHashCode%2A>, throw a <xref:System.NotSupportedException>.
49+
`Span<T>` is a [ref struct](~/docs/csharp/language-reference/builtin-types/struct.md#ref-struct) that is allocated on the stack rather than on the managed heap. Ref struct types have a number of restrictions to ensure that they cannot be promoted to the managed heap, including that they can't be boxed, they can't be assigned to variables of type <xref:System.Object>, `dynamic` or to any interface type, they can't be fields in a reference type, and they can't be used across `await` and `yield` boundaries. In addition, calls to two methods, <xref:System.Span%601.Equals(System.Object)> and <xref:System.Span%601.GetHashCode%2A>, throw a <xref:System.NotSupportedException>.
5050
5151
> [!IMPORTANT]
5252
> Because it is a stack-only type, `Span<T>` is unsuitable for many scenarios that require storing references to buffers on the heap. This is true, for example, of routines that make asynchronous method calls. For such scenarios, you can use the complementary <xref:System.Memory%601?displayProperty=nameWithType> and <xref:System.ReadOnlyMemory%601?displayProperty=nameWithType> types.
@@ -394,7 +394,7 @@ This method copies all of `source` to `destination` even if `source` and `destin
394394
<format type="text/markdown"><![CDATA[
395395
Calls to the <xref:System.Span%601.Equals%2A> method are not supported. Calls to the <xref:System.Span%601.Equals%2A> methods produce either of two results:
396396
397-
- If `obj` is a <xref:System.Span%601>, the method call generates compiler error CS1503: "cannot convert from 'System.Span' to 'object'." This is because <xref:System.Span%601> is a [ref struct](~/docs/csharp/reference-semantics-with-value-types.md#ref-struct-type) that cannot be boxed and therefore cannot be converted to an <xref:System.Object>.
397+
- If `obj` is a <xref:System.Span%601>, the method call generates compiler error CS1503: "cannot convert from 'System.Span' to 'object'." This is because <xref:System.Span%601> is a [ref struct](~/docs/csharp/language-reference/builtin-types/struct.md#ref-struct) that cannot be boxed and therefore cannot be converted to an <xref:System.Object>.
398398
399399
- If the type of `obj` is not a <xref:System.Span%601>, the method call throws a <xref:System.NotSupportedException>.
400400
@@ -543,7 +543,7 @@ Instead of calling the <xref:System.Span%601.GetEnumerator%2A> method directly,
543543
<remarks>
544544
<format type="text/markdown"><![CDATA[
545545
546-
The `GetPinnableReference` method returns a [ref struct](~/docs/csharp/reference-semantics-with-value-types.md#ref-struct-type). It can be used for pinning a <xref:System.Span%601> in memory. It is required to support the use of a <xref:System.Span%601> within a [fixed](~/docs/csharp/language-reference/keywords/fixed-statement.md) statement.
546+
The `GetPinnableReference` method returns a [ref struct](~/docs/csharp/language-reference/builtin-types/struct.md#ref-struct). It can be used for pinning a <xref:System.Span%601> in memory. It is required to support the use of a <xref:System.Span%601> within a [fixed](~/docs/csharp/language-reference/keywords/fixed-statement.md) statement.
547547
548548
]]></format>
549549
</remarks>

xml/System/Type.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11129,7 +11129,7 @@ GetType(Array).IsAssignableFrom(type)
1112911129
<format type="text/markdown"><![CDATA[
1113011130

1113111131
## Remarks
11132-
Byref-like structures are declared using `ref struct` keyword in C#. An instance of the byref-like structure can't be placed on the managed heap. For more information, see [Ref struct types](~/docs/csharp/language-reference/keywords/ref.md#ref-struct-types).
11132+
Byref-like structures are declared using `ref struct` keyword in C#. An instance of the byref-like structure can't be placed on the managed heap. For more information, see [Ref struct](~/docs/csharp/language-reference/builtin-types/struct.md#ref-struct).
1113311133

1113411134
]]></format>
1113511135
</remarks>

0 commit comments

Comments
 (0)