A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://dotnet.github.io/dotNext/api/DotNext.Buffers.MemoryOwner-1.html below:

Struct MemoryOwner<T> | .NEXT

Struct MemoryOwner<T>

Represents unified representation of the memory rented using various types of memory pools.

Namespace: DotNext.Buffers Assembly: DotNext.dll Syntax
public struct MemoryOwner<T> : IMemoryOwner<T>, IDisposable, ISupplier<Memory<T>>, IFunctional<Func<Memory<T>>>, ISupplier<ReadOnlyMemory<T>>, IFunctional<Func<ReadOnlyMemory<T>>>
Type Parameters Name Description T

The type of the items in the memory pool.

Constructors | Edit this page View Source MemoryOwner(ArrayPool<T>, int)

Rents the array from the pool.

Declaration
public MemoryOwner(ArrayPool<T> pool, int length)
Parameters Type Name Description ArrayPool<T> pool

The array pool.

int length

The length of the array.

| Edit this page View Source MemoryOwner(MemoryPool<T>, int)

Rents the memory from the pool.

Declaration
public MemoryOwner(MemoryPool<T> pool, int length = -1)
Parameters Type Name Description MemoryPool<T> pool

The memory pool.

int length

The number of elements to rent; or -1 to rent default amount of memory.

| Edit this page View Source MemoryOwner(Func<IMemoryOwner<T>>)

Rents the memory.

Declaration
public MemoryOwner(Func<IMemoryOwner<T>> provider)
Parameters | Edit this page View Source MemoryOwner(Func<int, IMemoryOwner<T>>, int)

Rents the memory.

Declaration
public MemoryOwner(Func<int, IMemoryOwner<T>> provider, int length)
Parameters Type Name Description Func<int, IMemoryOwner<T>> provider

The memory provider.

int length

The number of elements to rent.

| Edit this page View Source MemoryOwner(T[])

Wraps the array as if it was rented.

Declaration
public MemoryOwner(T[] array)
Parameters Type Name Description T[] array

The array to wrap.

| Edit this page View Source MemoryOwner(T[], int)

Wraps the array as if it was rented.

Declaration
public MemoryOwner(T[] array, int length)
Parameters Type Name Description T[] array

The array to wrap.

int length

The length of the array.

Exceptions Properties | Edit this page View Source IsEmpty

Determines whether this memory is empty.

Declaration
public readonly bool IsEmpty { get; }
Property Value | Edit this page View Source this[int]

Gets managed pointer to the item in the rented memory.

Declaration
public readonly ref T this[int index] { get; }
Parameters Type Name Description int index

The index of the element in memory.

Property Value Type Description T

The managed pointer to the item.

Exceptions | Edit this page View Source Length

Gets numbers of elements in the rented memory block.

Declaration
public readonly int Length { get; }
Property Value | Edit this page View Source Memory

Gets the memory belonging to this owner.

Declaration
public readonly Memory<T> Memory { get; }
Property Value Type Description Memory<T>

The memory belonging to this owner.

| Edit this page View Source Span

Gets the span over the memory belonging to this owner.

Declaration
public readonly Span<T> Span { get; }
Property Value Type Description Span<T>

The span over the memory belonging to this owner.

Methods | Edit this page View Source Dispose()

Releases rented memory.

Declaration | Edit this page View Source ToString()

Returns the fully qualified type name of this instance.

Declaration
public override readonly string ToString()
Returns Type Description string

The fully qualified type name.

Overrides | Edit this page View Source TryResize(int)

Attempts to resize this buffer without reallocation.

Declaration
public bool TryResize(int newLength)
Parameters Type Name Description int newLength

The requested length of this buffer.

Returns Type Description bool

true if this buffer is resized successfully; otherwise, false.

Exceptions Implements Extension Methods

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4