Remove pinning from ComPtr<T>.GetPinnableReference()

このコミットが含まれているのは:
Sergio Pedri committed 2022-09-16 10:38:38 -07:00
1 親 25ba356046
コミット d9dffde131
2ファイル変更
+5 -4

検索条件に一致するファイルはありません

+2
ファイルの表示
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using ComputeSharp.Core.Extensions;
@@ -125,6 +126,7 @@ internal unsafe struct CommandList : IDisposable
/// </summary>
/// <returns>A double pointer to the current <see cref="ID3D12CommandList"/> object to execute.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[UnscopedRef]
public readonly ref ID3D12CommandList* GetD3D12CommandListPinnableAddressOf()
{
// This method should return a ref ID3D12CommandList*, so it can't just call this.d3D12GraphicsCommandList.GetPinnableReference().
+3 -4
ファイルの表示
@@ -9,6 +9,7 @@ using System.Diagnostics;
using System.Runtime.CompilerServices;
using static TerraFX.Interop.Windows.Windows;
using static TerraFX.Interop.Windows.S;
using System.Diagnostics.CodeAnalysis;
namespace TerraFX.Interop.Windows
{
@@ -248,12 +249,10 @@ namespace TerraFX.Interop.Windows
/// <returns>The raw pointer to the current <see cref="ComPtr{T}"/> instance.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[EditorBrowsable(EditorBrowsableState.Never)]
[UnscopedRef]
public readonly ref T* GetPinnableReference()
{
fixed (T** ptr = &ptr_)
{
return ref *ptr;
}
return ref Unsafe.AsRef(in this).ptr_;
}
/// <summary>Releases the current COM object in use and gets the address of the <see cref="ComPtr{T}"/> instance as a raw <typeparamref name="T"/> double pointer. This method is only valid when the current <see cref="ComPtr{T}"/> instance is on the stack or pinned.</summary>