Remove leftover MemoryMarshal polyfills
このコミットが含まれているのは:
1 親
092fa1cd10
コミット
51f9b8e9d6
4ファイル変更
-75
検索条件に一致するファイルはありません
@@ -9,7 +9,6 @@
|
||||
<Import_RootNamespace>ComputeSharp.Core.NetStandard</Import_RootNamespace>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\InteropServices\MemoryMarshal.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime.CompilerServices\InterpolatedStringHandlerArgumentAttribute.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime.CompilerServices\InterpolatedStringHandlerAttribute.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime.CompilerServices\IsExternalInit.cs" />
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace ComputeSharp.Core.NetStandard.System.Runtime.InteropServices;
|
||||
|
||||
/// <summary>
|
||||
/// A polyfill type that mirrors some methods from <see cref="MemoryMarshal"/> on .NET 6.
|
||||
/// </summary>
|
||||
internal static class MemoryMarshal
|
||||
{
|
||||
/// <inheritdoc cref="global::System.Runtime.InteropServices.MemoryMarshal.GetReference{T}(Span{T})"/>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static ref T GetReference<T>(Span<T> span)
|
||||
{
|
||||
return ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(span);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="global::System.Runtime.InteropServices.MemoryMarshal.GetReference{T}(ReadOnlySpan{T})"/>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static ref T GetReference<T>(ReadOnlySpan<T> span)
|
||||
{
|
||||
return ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(span);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Span{T}"/> from a given reference.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of reference to wrap.</typeparam>
|
||||
/// <param name="value">The target reference.</param>
|
||||
/// <param name="length">The length of the <see cref="Span{T}"/> to create.</param>
|
||||
/// <returns>A new <see cref="Span{T}"/> wrapping <paramref name="value"/>.</returns>
|
||||
public static unsafe Span<T> CreateSpan<T>(ref T value, int length)
|
||||
{
|
||||
return new(Unsafe.AsPointer(ref value), length);
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする