Microsoft.Toolkit.HighPerformance.Buffers Namespace
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Classes
ArrayPoolBufferWriter<T> |
Represents a heap-based, array-backed output sink into which |
MemoryBufferWriter<T> |
Represents an output sink into which |
MemoryOwner<T> |
An IMemoryOwner<T> implementation with an embedded length and a fast Span<T> accessor. |
StringPool |
A configurable pool for String instances. This can be used to minimize allocations when creating multiple String instances from buffers of Char values. The GetOrAdd(ReadOnlySpan<Char>) method provides a best-effort alternative to just creating a new String instance every time, in order to minimize the number of duplicated instances. The StringPool type will internally manage a highly efficient priority queue for the cached String instances, so that when the full capacity is reached, the least frequently used values will be automatically discarded to leave room for new values to cache. |
Structs
SpanOwner<T> |
A stack-only type with the ability to rent a buffer of a specified length and getting a Span<T> from it. This type mirrors MemoryOwner<T> but without allocations and with further optimizations. As this is a stack-only type, it relies on the duck-typed IDisposable pattern introduced with C# 8. It should be used like so:
As soon as the code leaves the scope of that |
Interfaces
IBuffer<T> |
An interface that expands IBufferWriter<T> with the ability to also inspect the written data, and to reset the underlying buffer to write again from the start. |
Enums
AllocationMode |
An |