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
Copy file name to clipboardExpand all lines: xml/System.Buffers/IMemoryOwner`1.xml
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@
23
23
<remarks>
24
24
<formattype="text/markdown"><. This means that `Memory<T>` can be backed by:
33
-
34
-
- An array.
35
-
- A string (a sequence of characters).
36
-
- A <xref:System.Runtime.InteropServices.SafeHandle>.
37
-
38
-
`Memory<T>` cannot be backed by transient unmanaged memory, such as memory available by using [stackalloc](~/docs/csharp/language-reference/keywords/stackalloc.md).
39
-
40
-
Because the memory allocated to the `Memory<T>` structure is placed on the managed heap, it does not have the same restrictions as a <xref:System.Span%601> instance. In particular:
32
+
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](~/doocs/csharp/reference-semantics-with-value-types?view=netcore-2.1.md#ref-struct-type). 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:
41
33
42
34
- It can be used as a field in a class.
43
35
44
36
- It can be used across `await` and `yield` boundaries.
45
37
46
38
In addition to `Memory<T>`, you can use <xref:System.ReadOnlyMemory%601?displayProperty=nameWithType> to represent immutable or read-only memory.
47
39
48
-
### Memory<T> basics
49
-
50
-
51
40
]]></format>
52
41
</remarks>
53
42
</Docs>
@@ -73,12 +62,17 @@ In addition to `Memory<T>`, you can use <xref:System.ReadOnlyMemory%601?displayP
73
62
<remarks>
74
63
<formattype="text/markdown"><![CDATA[
75
64
76
-
If `array` is `null`, this constructor returns a `null` <xref:System.Memory%601> object.
65
+
If `array` is `null`, this constructor returns a <xref:System.Memory%601> object with a `default<T>` value.
<paramrefname="T" /> is a reference type, and <paramrefname="array" /> is not an array of type <paramrefname="T" />.</exception>
70
+
<paramrefname="T" /> is a reference type, and <paramrefname="array" /> is not an array of type <paramrefname="T" />.
71
+
72
+
-or-
73
+
74
+
The array is <seehref="~/docs/csharp/programming-guide/concepts/covariance-contravariance/index.md" />covariant.</see>
75
+
</exception>
82
76
</Docs>
83
77
</Member>
84
78
<MemberMemberName=".ctor">
@@ -106,7 +100,7 @@ If `array` is `null`, this constructor returns a `null` <xref:System.Memory%601>
106
100
<remarks>
107
101
<formattype="text/markdown"><![CDATA[
108
102
109
-
If `array` is `null`, this constructor returns a `null` <xref:System.Memory%601> object.
103
+
If `array` is `null`, this constructor returns a <xref:System.Memory%601> object with a `default<T>` value.
110
104
111
105
]]></format>
112
106
</remarks>
@@ -201,7 +195,9 @@ The two objects are equal if:
201
195
- `other` is a <xref:System.Memory%601> or <xref:System.ReadOnlyMemory%601> object.
202
196
203
197
- Both objects point to the same array and have the same length.
204
-
198
+
199
+
The `Equals(Memory<T>)` method performs a test for reference equality; it does not compare the elements of <xref:Memory%601> for equality.
200
+
205
201
]]></format>
206
202
</remarks>
207
203
</Docs>
@@ -470,7 +466,7 @@ The garbage collector will not move the memory until the returned <xref:T:System
470
466
<paramname="start">The index at which to begin the slice.</param>
471
467
<paramname="length">The number of elements to include in the slice.</param>
472
468
<summary>Forms a slice out of the current memory starting at a specified index for a specified length.</summary>
473
-
<returns>An object that <paramrefname="length" /> elements from the current instance starting at <paramrefname="start" />. </returns>
469
+
<returns>An object that contains <paramrefname="length" /> elements from the current instance starting at <paramrefname="start" />. </returns>
474
470
<remarks>To be added.</remarks>
475
471
<exceptioncref="T:System.ArgumentOutOfRangeExceptionException"><paramrefname="start" /> is less than zero or greater than or equal to <seecref="P:Memory`1.Length" />.
Copy file name to clipboardExpand all lines: xml/System/Span`1.xml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,7 @@ The following example creates a slice of the middle five elements of a 10-elemen
69
69
70
70
## Span\<T> and slices
71
71
72
-
`Span\<T>` includes two overloads of the <xref:System.Span%601.Slice%2A> method that forms a slice out of the current span that starts at a specified index. This makes it possible to treat the data in a `Span\<T>` as a set of logical chunks that can be processed as needed by portions of a data processing pipeline with minimal performance impact. For example, since modern server protocols are often text-based, manipulation of strings and substrings is particularly important. In the <xref:System.String> class, the major method for extracting substrings is <xref:System.String.Substring%2A>. For data pipelines that rely on extensive string manipulation, it use offers some performance penalties, since it:
72
+
`Span\<T>` includes two overloads of the <xref:System.Span%601.Slice%2A> method that forms a slice out of the current span that starts at a specified index. This makes it possible to treat the data in a `Span\<T>` as a set of logical chunks that can be processed as needed by portions of a data processing pipeline with minimal performance impact. For example, since modern server protocols are often text-based, manipulation of strings and substrings is particularly important. In the <xref:System.String> class, the major method for extracting substrings is <xref:System.String.Substring%2A>. For data pipelines that rely on extensive string manipulation, its use offers some performance penalties, since it:
0 commit comments