Skip to content

Commit 42a585f

Browse files
MSDN-WhiteKnightRon Petrusha
authored andcommitted
Update MemoryMarshal.xml (#2538)
- Add documentation for AsRef methods - Fix typos: "Tries to writes"; unneeded backticks.
1 parent 2fd6143 commit 42a585f

File tree

1 file changed

+36
-16
lines changed

1 file changed

+36
-16
lines changed

xml/System.Runtime.InteropServices/MemoryMarshal.xml

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,21 @@ This method must be used with extreme caution. <xref:System.ReadOnlyMemory%601>
204204
<Parameter Name="span" Type="System.ReadOnlySpan&lt;System.Byte&gt;" Index="0" FrameworkAlternate="netcore-3.0" />
205205
</Parameters>
206206
<Docs>
207-
<typeparam name="T">To be added.</typeparam>
208-
<param name="span">To be added.</param>
209-
<summary>To be added.</summary>
210-
<returns>To be added.</returns>
211-
<remarks>To be added.</remarks>
207+
<typeparam name="T">The type of the returned reference.</typeparam>
208+
<param name="span">The read-only span to reinterpret.</param>
209+
<summary>Reinterprets a read-only span of bytes as a read-only reference to the structure of type <paramref name="T" />.</summary>
210+
<returns>The read-only reference to the structure of type <paramref name="T" />.</returns>
211+
<remarks>
212+
<format type="text/markdown"><![CDATA[
213+
214+
## Remarks
215+
216+
`T` cannot contain pointers or references. It is checked at runtime in order to preserve type safety.
217+
218+
This method is supported only on platforms that support misaligned memory access or when the memory block is aligned by other means.
219+
220+
]]></format>
221+
</remarks>
212222
</Docs>
213223
</Member>
214224
<Member MemberName="AsRef&lt;T&gt;">
@@ -242,11 +252,21 @@ This method must be used with extreme caution. <xref:System.ReadOnlyMemory%601>
242252
<Parameter Name="span" Type="System.Span&lt;System.Byte&gt;" Index="0" FrameworkAlternate="netcore-3.0" />
243253
</Parameters>
244254
<Docs>
245-
<typeparam name="T">To be added.</typeparam>
246-
<param name="span">To be added.</param>
247-
<summary>To be added.</summary>
248-
<returns>To be added.</returns>
249-
<remarks>To be added.</remarks>
255+
<typeparam name="T">The type of the returned reference.</typeparam>
256+
<param name="span">The span to reinterpret.</param>
257+
<summary>Reinterprets a span of bytes as a reference to the structure of type <paramref name="T" />.</summary>
258+
<returns>The reference to the structure of type <paramref name="T" />.</returns>
259+
<remarks>
260+
<format type="text/markdown"><![CDATA[
261+
262+
## Remarks
263+
264+
`T` cannot contain pointers or references. It is checked at runtime in order to preserve type safety.
265+
266+
This method is supported only on platforms that support misaligned memory access or when the memory block is aligned by other means.
267+
268+
]]></format>
269+
</remarks>
250270
</Docs>
251271
</Member>
252272
<Member MemberName="Cast&lt;TFrom,TTo&gt;">
@@ -645,7 +665,7 @@ If the span is empty, this method returns a reference to the location where the
645665
646666
## Remarks
647667
648-
`T` cannot contain pointers or references. `It is checked at runtime in order to preserve type safety.
668+
`T` cannot contain pointers or references. It is checked at runtime in order to preserve type safety.
649669
650670
]]></format>
651671
</remarks>
@@ -910,7 +930,7 @@ This method allows a read-only memory buffer to be used in existing APIs that re
910930
911931
## Remarks
912932
913-
`T` cannot contain pointers or references. `It is checked at runtime in order to preserve type safety.
933+
`T` cannot contain pointers or references. It is checked at runtime in order to preserve type safety.
914934
915935
]]></format>
916936
</remarks>
@@ -956,15 +976,15 @@ This method allows a read-only memory buffer to be used in existing APIs that re
956976
<typeparam name="T">The type of the structure.</typeparam>
957977
<param name="destination">The span of bytes to contain the structure.</param>
958978
<param name="value">The structure to be written to the span.</param>
959-
<summary>Tries to writes a structure of type <paramref name="T" /> into a span of bytes.</summary>
979+
<summary>Tries to write a structure of type <paramref name="T" /> into a span of bytes.</summary>
960980
<returns>
961981
<see langword="true" /> if the write operation succeeded; otherwise, <see langword="false" />. The method returns <see langword="false" /> if the span is too small to contain <paramref name="T" />. </returns>
962982
<remarks>
963983
<format type="text/markdown"><![CDATA[
964984
965985
## Remarks
966986
967-
`T` cannot contain pointers or references. `It is checked at runtime in order to preserve type safety.
987+
`T` cannot contain pointers or references. It is checked at runtime in order to preserve type safety.
968988
969989
]]></format>
970990
</remarks>
@@ -1016,7 +1036,7 @@ This method allows a read-only memory buffer to be used in existing APIs that re
10161036
10171037
## Remarks
10181038
1019-
`T` cannot contain pointers or references. `It is checked at runtime in order to preserve type safety.
1039+
`T` cannot contain pointers or references. It is checked at runtime in order to preserve type safety.
10201040
10211041
]]></format>
10221042
</remarks>
@@ -1027,4 +1047,4 @@ This method allows a read-only memory buffer to be used in existing APIs that re
10271047
</Docs>
10281048
</Member>
10291049
</Members>
1030-
</Type>
1050+
</Type>

0 commit comments

Comments
 (0)