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

适用于