Memory<T> How to wrap references unmanaged memory?

陈百川 1 Reputation point

Span<T> can pass void* through the constructor to refer to unmanaged Memory, but what about Memory<T>? I didn't find a Mothod to do that. IMemoryOwner<T> contains an property of type Memory<T>. If Memory<T> could wrap references to managed or unmanaged memory, it would be more generic, wouldn't it?
Can Memory<T> actually reference unmanaged memory? What did I miss?
Why is the document written this way? link:memory-t-usage-guidelines


An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
8,237 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: The period of time during which a program is being executed in a computer.
1,002 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jiachen Li-MSFT 14,216 Reputation points Microsoft Vendor

    Hi @陈百川 ,
    Please check if this helps.
    Best Regards.
    Jiachen Li


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments