Memory Struct (System) (original) (raw)
- Reference
Definition
Namespace:
Assemblies:
netstandard.dll, System.Runtime.dll
Assembly:
System.Runtime.dll
Assembly:
System.Memory.dll
Assembly:
netstandard.dll
Package:
System.Memory v4.6.3
Source:
Source:
Source:
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.
Represents a contiguous region of memory.
generic <typename T>
public value class Memory : IEquatable<Memory<T>>
generic <typename T>
public value class Memory
public readonly struct Memory<T> : IEquatable<Memory<T>>
public readonly struct Memory<T>
type Memory<'T> = struct
Public Structure Memory(Of T)
Implements IEquatable(Of Memory(Of T))
Public Structure Memory(Of T)
Type Parameters
Inheritance
Implements
Remarks
Like Span, Memory<T>
represents a contiguous region of memory. Unlike Span, however, Memory<T>
is not a ref struct. This means that Memory<T>
can be placed on the managed heap, whereas Span cannot. As a result, the Memory<T>
structure does not have the same restrictions as a Span instance. In particular:
- It can be used as a field in a class.
- It can be used across
await
andyield
boundaries.
In addition to Memory<T>
, you can use System.ReadOnlyMemory to represent immutable or read-only memory.