Open chrisgull opened 5 years ago
Spans never copy anything by themselves. That would defeat their purpose, to be able to access portions of an array or arbitrary memory in an uniform manner and without significant overhead.
Right - issue here is unclear documentation.
Doc is unclear - does Span<T>(Void*, Int32) refer to the original unmanaged memory block, or copy the unmanaged data into a T[] managed object, that is then pinned when a pinnable ref is requested? The former would certainly be desired, at least in some instances, but from tests it seems impossible to get the address of the original unmanaged object when requesting a pinnable ref. Doc needs to be clear here.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.