Marking the method has EditorBrowsableState.Never hurts usability for users (like ASP.NET) who want to use the API.
Since the developer needs to be careful with the use of this API (it can be considered unsafe, for instance, if someone calls it on an array that isn't already pre-pinned), we should consider moving it to MemoryMarshal instead, but not hide it.
namespace System
{
public readonly partial struct Memory<T>
{
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static Memory<T> CreateFromPinnedArray(T[] array, int start, int length) { throw null; }
}
}
namespace System.Runtime.InteropServices
{
public static partial class MemoryMarshal
{
+ public static Memory<T> CreateFromPinnedArray(T[] array, int start, int length) { throw null; }
}
}
cc @davidfowl, @GrabYourPitchforks, @stephentoub, @KrzysztofCwalina, @pakrym, @benaadams
Marking the method has
EditorBrowsableState.Neverhurts usability for users (like ASP.NET) who want to use the API.Since the developer needs to be careful with the use of this API (it can be considered unsafe, for instance, if someone calls it on an array that isn't already pre-pinned), we should consider moving it to MemoryMarshal instead, but not hide it.
namespace System { public readonly partial struct Memory<T> { - [EditorBrowsable(EditorBrowsableState.Never)] - public static Memory<T> CreateFromPinnedArray(T[] array, int start, int length) { throw null; } } } namespace System.Runtime.InteropServices { public static partial class MemoryMarshal { + public static Memory<T> CreateFromPinnedArray(T[] array, int start, int length) { throw null; } } }cc @davidfowl, @GrabYourPitchforks, @stephentoub, @KrzysztofCwalina, @pakrym, @benaadams