Show / Hide Table of Contents

Interface IUnmanagedMemory

Represents common interface for the wrapper of the unmanaged memory.

Inherited Members
IDisposable.Dispose()
ISupplier<Stream>.Invoke()
ISupplier<Stream>.NullOrDefault
IFunctional<Func<Stream>>.ToDelegate()
Namespace: DotNext.Runtime.InteropServices
Assembly: DotNext.Unsafe.dll
Syntax
[CLSCompliant(false)]
public interface IUnmanagedMemory : IDisposable, ISupplier<Stream>, IFunctional<Func<Stream>>

Properties

| Edit this page View Source

Bytes

Gets a span of bytes from the current instance.

Declaration
Span<byte> Bytes { get; }
Property Value
Type Description
Span<byte>
Exceptions
Type Condition
ObjectDisposedException

The underlying unmanaged memory has been released.

| Edit this page View Source

Pointer

Gets a pointer to the allocated unmanaged memory.

Declaration
Pointer<byte> Pointer { get; }
Property Value
Type Description
Pointer<byte>
Exceptions
Type Condition
ObjectDisposedException

The underlying unmanaged memory has been released.

| Edit this page View Source

Size

Gets size of referenced unmanaged memory, in bytes.

Declaration
nuint Size { get; }
Property Value
Type Description
nuint

Methods

| Edit this page View Source

AsStream()

Represents unmanaged memory as stream.

Declaration
Stream AsStream()
Returns
Type Description
Stream

The stream of unmanaged memory.

Exceptions
Type Condition
ObjectDisposedException

The underlying unmanaged memory has been released.

| Edit this page View Source

Clear()

Sets all bits of allocated memory to zero.

Declaration
void Clear()
Exceptions
Type Condition
ObjectDisposedException

The underlying unmanaged memory has been released.

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.GetUserData<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, ReadOnlySpan<T>)
ExpressionBuilder.Const<T>(T)
AsyncLockAcquisition.AcquireLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireReadLockAsync<T>(T, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, bool, TimeSpan, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, CancellationToken)
AsyncLockAcquisition.AcquireWriteLockAsync<T>(T, TimeSpan, CancellationToken)
LockAcquisition.AcquireReadLock<T>(T)
LockAcquisition.AcquireReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireUpgradeableReadLock<T>(T)
LockAcquisition.AcquireUpgradeableReadLock<T>(T, TimeSpan)
LockAcquisition.AcquireWriteLock<T>(T)
LockAcquisition.AcquireWriteLock<T>(T, TimeSpan)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾