diff options
-rw-r--r-- | src/mscorlib/shared/System/Memory.cs | 5 | ||||
-rw-r--r-- | src/mscorlib/shared/System/ReadOnlyMemory.cs | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/mscorlib/shared/System/Memory.cs b/src/mscorlib/shared/System/Memory.cs index 26f4e4ce19..98ec23fd67 100644 --- a/src/mscorlib/shared/System/Memory.cs +++ b/src/mscorlib/shared/System/Memory.cs @@ -318,8 +318,11 @@ namespace System /// <summary> /// Creates a handle for the memory. - /// The GC will not move the array until the returned <see cref="MemoryHandle"/> + /// The GC will not move the memory until the returned <see cref="MemoryHandle"/> /// is disposed, enabling taking and using the memory's address. + /// <exception cref="System.ArgumentException"> + /// An instance with nonprimitive (non-blittable) members cannot be pinned. + /// </exception> /// </summary> public unsafe MemoryHandle Pin() { diff --git a/src/mscorlib/shared/System/ReadOnlyMemory.cs b/src/mscorlib/shared/System/ReadOnlyMemory.cs index 3e7884528e..ae8a7c3001 100644 --- a/src/mscorlib/shared/System/ReadOnlyMemory.cs +++ b/src/mscorlib/shared/System/ReadOnlyMemory.cs @@ -235,8 +235,11 @@ namespace System /// <summary> /// Creates a handle for the memory. - /// The GC will not move the array until the returned <see cref="MemoryHandle"/> + /// The GC will not move the memory until the returned <see cref="MemoryHandle"/> /// is disposed, enabling taking and using the memory's address. + /// <exception cref="System.ArgumentException"> + /// An instance with nonprimitive (non-blittable) members cannot be pinned. + /// </exception> /// </summary> public unsafe MemoryHandle Pin() { |