File tree Expand file tree Collapse file tree 3 files changed +5
-0
lines changed
Expand file tree Collapse file tree 3 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ public readonly unsafe struct ByReference<T>
1616 private readonly void * _ptr ;
1717 /// <summary>
1818 /// Initialize a <see cref="ByReference{T}"/> with a <typeparamref name="T"/> reference.
19+ /// Note: the storage of value should be pinned.
1920 /// </summary>
2021 /// <param name="value">The reference.</param>
2122 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ public Pointer(IntPtr ptr)
3838 }
3939 /// <summary>
4040 /// Initialize a <see cref="Pointer{T}"/> with a <typeparamref name="T"/> reference.
41+ /// Note: the storage of value should be pinned.
4142 /// </summary>
4243 /// <param name="ptr">The reference.</param>
4344 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ public unsafe static class UnsafeMethods
1818 public static int GetSize < T > ( ) => SizeOf < T > ( ) ;
1919 /// <summary>
2020 /// Get a <see cref="Pointer{T}"/> with a <typeparamref name="T"/> reference.
21+ /// Note: the storage of value should be pinned.
2122 /// </summary>
2223 /// <typeparam name="T">Type of the pointer pointed to.</typeparam>
2324 /// <param name="value">The reference.</param>
@@ -47,6 +48,7 @@ public static Pointer<char> PointerOf(string str)
4748 }
4849 /// <summary>
4950 /// Get a <see cref="Unsafe.ByReference{T}"/> with a <typeparamref name="T"/> reference.
51+ /// Note: the storage of value should be pinned.
5052 /// </summary>
5153 /// <typeparam name="T">Type of the pointer pointed to.</typeparam>
5254 /// <param name="value">The reference.</param>
@@ -55,6 +57,7 @@ public static Pointer<char> PointerOf(string str)
5557 public static ByReference < T > ByReference < T > ( ref T value ) => new ByReference < T > ( ref value ) ;
5658 /// <summary>
5759 /// Get a <see cref="Unsafe.ByReference{T}"/> with a readonly <typeparamref name="T"/> reference.
60+ /// Note: the storage of value should be pinned.
5861 /// </summary>
5962 /// <typeparam name="T">Type of the pointer pointed to.</typeparam>
6063 /// <param name="value">The reference.</param>
You can’t perform that action at this time.
0 commit comments