Op Englesch liesen Editéieren

Deelen iwwer


ReadOnlyMemory<T>.Pin Method

Definition

Creates a handle for the memory.

C#
public System.Buffers.MemoryHandle Pin();

Returns

A handle for the memory.

Exceptions

An instance with nonprimitive (non-blittable) members cannot be pinned.

Remarks

Wichteg

The garbage collector will not move the memory until the returned MemoryHandle is disposed, which enables taking and using the memory's address.

Applies to

Produkt Versiounen
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided), 2.1