SpanMarshaller<T,TUnmanagedElement>.ManagedToUnmanagedIn.GetPinnableReference Method

Definition

Overloads

GetPinnableReference()

Returns a reference to the marshalled array.

GetPinnableReference(Span<T>)

Gets a pinnable reference to the managed span.

GetPinnableReference()

Source:
SpanMarshaller.cs
Source:
SpanMarshaller.cs
Source:
SpanMarshaller.cs

Returns a reference to the marshalled array.

C#
public ref TUnmanagedElement GetPinnableReference();

Returns

TUnmanagedElement

A reference that can be pinned and directly passed to unmanaged code.

Applies to

.NET 10 and other versions
Product Versions
.NET 7, 8, 9, 10

GetPinnableReference(Span<T>)

Source:
SpanMarshaller.cs
Source:
SpanMarshaller.cs
Source:
SpanMarshaller.cs

Gets a pinnable reference to the managed span.

C#
public static ref T GetPinnableReference(Span<T> managed);

Parameters

managed
Span<T>

The managed span.

Returns

T

A reference that can be pinned and directly passed to unmanaged code.

Applies to

.NET 10 and other versions
Product Versions
.NET 7, 8, 9, 10