3 instantiations of ReferenceCountedDisposable
Microsoft.CodeAnalysis.CodeStyle (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ReferenceCountedDisposable.cs (2)
45/// <para>Only use the <see cref="ReferenceCountedDisposable{T}(T)"/> constructor one time per target object. 164return new ReferenceCountedDisposable<T>(target, referenceCount);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ReferenceCountedDisposableCache.cs (1)
44disposable = new ReferenceCountedDisposable<Entry>(new Entry(this, key, valueCreator(key, arg)));
19 references to ReferenceCountedDisposable
Microsoft.CodeAnalysis.CodeStyle (19)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IReferenceCountedDisposable.cs (3)
10/// A covariant interface form of <see cref="ReferenceCountedDisposable{T}"/> that lets you re-cast an <see cref="ReferenceCountedDisposable{T}"/> 39/// <returns>A new <see cref="ReferenceCountedDisposable{T}"/> pointing to the same underlying object, if it
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ReferenceCountedDisposable.cs (13)
18/// <para>Each instance of <see cref="ReferenceCountedDisposable{T}"/> represents a counted reference (also 30/// <para>While each instance of <see cref="ReferenceCountedDisposable{T}"/> should be explicitly disposed when 39/// <para>When using <see cref="ReferenceCountedDisposable{T}"/>, certain steps must be taken to ensure the 43/// <para>Use <see cref="ReferenceCountedDisposable{T}"/> consistently. In other words, do not mix code using 118public T Target => _instance ?? throw new ObjectDisposedException(nameof(ReferenceCountedDisposable<T>)); 127/// <returns>A new <see cref="ReferenceCountedDisposable{T}"/> pointing to the same underlying object, if it 130public ReferenceCountedDisposable<T>? TryAddReference() 140private static ReferenceCountedDisposable<T>? TryAddReferenceImpl(T? target, BoxedReferenceCount referenceCount) 221/// Represents a weak reference to a <see cref="ReferenceCountedDisposable{T}"/> which is capable of 231public WeakReference(ReferenceCountedDisposable<T> reference) 267/// <para>Unlike <see cref="ReferenceCountedDisposable{T}.TryAddReference"/>, this method is capable of 274/// <returns>A new <see cref="ReferenceCountedDisposable{T}"/> pointing to the same underlying object, 277public ReferenceCountedDisposable<T>? TryAddReference()
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\ReferenceCountedDisposableCache.cs (3)
19private readonly Dictionary<TKey, ReferenceCountedDisposable<Entry>.WeakReference> _cache = []; 26ReferenceCountedDisposable<Entry>? disposable = null; 45_cache[key] = new ReferenceCountedDisposable<Entry>.WeakReference(disposable);