Show / Hide Table of Contents

Struct UnmanagedMemory<T>

Represents a handle to the value of type T allocated in the unmanaged memory.

Implements
IUnmanagedMemory
IDisposable
Inherited Members
ValueType.Equals(object)
ValueType.GetHashCode()
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: DotNext.Runtime.InteropServices
Assembly: DotNext.Unsafe.dll
Syntax
public struct UnmanagedMemory<T> : IUnmanagedMemory, IDisposable where T : unmanaged
Type Parameters
Name Description
T

The type of the value.

Constructors

View Source

UnmanagedMemory()

Represents a handle to the value of type T allocated in the unmanaged memory.

Declaration
public UnmanagedMemory()
View Source

UnmanagedMemory(T)

Allocates a new unmanaged memory for the type T and places the specified value to the allocated space.

Declaration
public UnmanagedMemory(T value)
Parameters
Type Name Description
T value

The value to be placed to the allocated space.

Fields

View Source

Pointer

Represents the pointer to the allocated memory.

Declaration
public readonly Pointer<T> Pointer
Field Value
Type Description
Pointer<T>

Properties

View Source

Bytes

Gets the raw representation of the referenced memory.

Declaration
public Span<byte> Bytes { get; }
Property Value
Type Description
Span<byte>

Methods

View Source

Dispose()

Releases the unmanaged memory.

Declaration
public void Dispose()
View Source

ToString()

Declaration
public override readonly string ToString()
Returns
Type Description
string
Overrides
ValueType.ToString()

Implements

IUnmanagedMemory
IDisposable

Extension Methods

BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, params ReadOnlySpan<T>)
Enumerator.Skip<TEnumerator, T>(ref TEnumerator, int)
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾