Fixed resource descriptor handles allocation over 4096

このコミットが含まれているのは:
Sergio Pedri committed 2020-12-07 20:00:12 +01:00
1 親 8dd72da729
コミット b8a991b89d
6ファイル変更
+166 -50

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

+8 -8
ファイルの表示
@@ -8,11 +8,6 @@ namespace ComputeSharp.Core.Interop
/// </summary>
public abstract class NativeObject : IDisposable
{
/// <summary>
/// Indicates whether or not the current instance has already been disposed.
/// </summary>
private bool isDisposed;
/// <summary>
/// Releases unmanaged resources and performs other cleanup operations.
/// </summary>
@@ -21,6 +16,11 @@ namespace ComputeSharp.Core.Interop
CheckAndDispose();
}
/// <summary>
/// Gets whether or not the current instance has already been disposed.
/// </summary>
internal bool IsDisposed { get; private set; }
/// <summary>
/// Releases all the native resources for the current instance.
/// </summary>
@@ -36,9 +36,9 @@ namespace ComputeSharp.Core.Interop
/// </summary>
private void CheckAndDispose()
{
if (!this.isDisposed)
if (!IsDisposed)
{
this.isDisposed = true;
IsDisposed = true;
OnDispose();
}
@@ -55,7 +55,7 @@ namespace ComputeSharp.Core.Interop
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal void ThrowIfDisposed()
{
if (this.isDisposed)
if (IsDisposed)
{
// We can't use ThrowHelper here as we only want to invoke ToString if we
// are about to throw an exception. The JIT will recognize this pattern