Table of Contents

Class PinnedMemoryOperations

Namespace
DotCompute.Memory
Assembly
DotCompute.Memory.dll

Pinned memory utilities for interop scenarios.

public static class PinnedMemoryOperations
Inheritance
PinnedMemoryOperations
Inherited Members

Methods

Pin<T>(ReadOnlySpan<T>)

Creates a pinned memory handle for a read-only span.

public static PinnedMemoryHandle<T> Pin<T>(this ReadOnlySpan<T> span) where T : unmanaged

Parameters

span ReadOnlySpan<T>

Span to pin.

Returns

PinnedMemoryHandle<T>

Pinned memory handle.

Type Parameters

T

Element type.

Pin<T>(Span<T>)

Creates a pinned memory handle for a span.

public static PinnedMemoryHandle<T> Pin<T>(this Span<T> span) where T : unmanaged

Parameters

span Span<T>

Span to pin.

Returns

PinnedMemoryHandle<T>

Pinned memory handle.

Type Parameters

T

Element type.