Memory<T>.Pin Memory<T>.Pin Memory<T>.Pin Memory<T>.Pin Method

定义

Memory<T> 对象创建句柄。Creates a handle for the Memory<T> object.

public:
 System::Buffers::MemoryHandle Pin();
public System.Buffers.MemoryHandle Pin ();
member this.Pin : unit -> System.Buffers.MemoryHandle
Public Function Pin () As MemoryHandle

返回

Memory<T> 对象的句柄。A handle for the Memory<T> object.

异常

具有非基元(非直接复制到本机结构中的)成员的实例不能被固定。An instance with non-primitive (non-blittable) members cannot be pinned.

注解

请参阅See also

垃圾回收器不会返回之前移动内存MemoryHandle释放对象。The garbage collector will not move the memory until the returned MemoryHandle object is disposed. 这使您能够检索和使用的内存地址。This enables you to retrieve and use the memory's address.

IsPrimitive

适用于