2 types derived from Stack
InMemory.FunctionalTests (1)
src\Servers\Kestrel\shared\test\DisposableStack.cs (1)
9public class DisposableStack<T> : Stack<T>, IDisposable
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
src\Servers\Kestrel\shared\test\DisposableStack.cs (1)
9public class DisposableStack<T> : Stack<T>, IDisposable
310 instantiations of Stack
ConfigurationSchemaGenerator (1)
ConfigSchemaEmitter.cs (1)
36private readonly Stack<TypeSpec> _visitedTypes = new();
DesignSurfaceExt (2)
UndoEngineExt.cs (2)
10private readonly Stack<UndoUnit> _undoStack = new(); 11private readonly Stack<UndoUnit> _redoStack = new();
dotnet-svcutil-lib (11)
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathDocumentBuilder.cs (1)
72_stkNmsp = new Stack<XPathNodeRef>();
FrameworkFork\Microsoft.Xml\Xml\schema\ContentValidator.cs (4)
482Stack<InteriorNode> nodeStack = new Stack<InteriorNode>(); 542Stack<SequenceConstructPosContext> contextStack = new Stack<SequenceConstructPosContext>(); 643Stack<SequenceNode> nodeStack = new Stack<SequenceNode>(); 727Stack<ChoiceNode> nodeStack = new Stack<ChoiceNode>();
FrameworkFork\Microsoft.Xml\Xml\schema\DtdParser.cs (1)
1042Stack<ParseElementOnlyContent_LocalFrame> localFrames = new Stack<ParseElementOnlyContent_LocalFrame>();
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\precedingsibling.cs (1)
52Stack<XPathNavigator> inputStk = new Stack<XPathNavigator>();
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeGenerator.cs (1)
222_blockStack = new Stack<object>();
FrameworkFork\System.ServiceModel\Internals\System\Runtime\InternalBufferManager.cs (1)
464_items = new Stack<byte[]>(limit);
FrameworkFork\System.ServiceModel\Internals\System\Runtime\SynchronizedPool.cs (1)
352_items = new Stack<T>();
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MetadataExchangeClient.cs (1)
470_stackedRetrievers = new Stack<MetadataRetriever>();
Identity.DefaultUI.WebSite (1)
StartupBase.cs (1)
87var pendingProviders = new Stack<IFileProvider>();
illink (15)
ILLink.Tasks (1)
CreateRuntimeRootDescriptorFile.cs (1)
494 readonly Stack<bool?> activeSections = new Stack<bool?> ();
InMemory.FunctionalTests (2)
ResponseTests.cs (2)
3318var callOrder = new Stack<int>(); 3369var callOrder = new Stack<int>();
Microsoft.AspNetCore.App.Analyzers.Test (2)
RouteEmbeddedLanguage\Infrastructure\MarkupTestFile.cs (2)
65var spanStartStack = new Stack<(int matchIndex, string name)>(); 66var namedSpanStartStack = new Stack<(int matchIndex, string name)>();
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (1)
UserJwtsTestFixture.cs (1)
11private readonly Stack<Action> _disposables = new();
Microsoft.AspNetCore.Components (2)
Rendering\RenderTreeBuilder.cs (1)
26private readonly Stack<int> _openElementIndices = new Stack<int>();
src\Http\Routing\src\Tree\TreeEnumerator.cs (1)
18_stack = new Stack<UrlMatchingNode>();
Microsoft.AspNetCore.Components.Endpoints (2)
FormMapping\Converters\CollectionAdapters\StackBufferAdapter.cs (1)
8public static Stack<TElement> CreateBuffer() => new();
Rendering\EndpointHtmlRenderer.EventDispatch.cs (1)
190Stack<string> stack = new();
Microsoft.AspNetCore.Components.Endpoints.Tests (1)
Binding\FormDataMapperTests.cs (1)
777var expected = new Stack<int>(new[] { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 });
Microsoft.AspNetCore.Components.Server (2)
BlazorPack\SequenceOfT.cs (1)
25private readonly Stack<SequenceSegment> segmentPool = new Stack<SequenceSegment>();
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequencePool.cs (1)
40private readonly Stack<Sequence<byte>> pool = new Stack<Sequence<byte>>();
Microsoft.AspNetCore.Diagnostics (1)
src\Shared\RazorViews\BaseView.cs (1)
23private readonly Stack<TextWriter> _textWriterStack = new Stack<TextWriter>();
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (1)
src\Shared\RazorViews\BaseView.cs (1)
23private readonly Stack<TextWriter> _textWriterStack = new Stack<TextWriter>();
Microsoft.AspNetCore.Hosting (1)
src\Shared\RazorViews\BaseView.cs (1)
23private readonly Stack<TextWriter> _textWriterStack = new Stack<TextWriter>();
Microsoft.AspNetCore.Http.Extensions (1)
src\Components\Endpoints\src\FormMapping\Converters\CollectionAdapters\StackBufferAdapter.cs (1)
8public static Stack<TElement> CreateBuffer() => new();
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\DefaultModelBindingContext.cs (1)
27private readonly Stack<State> _stack = new Stack<State>();
Microsoft.AspNetCore.Mvc.Razor (2)
RazorPageBase.cs (2)
27private readonly Stack<TextWriter> _textWriterStack = new Stack<TextWriter>(); 142private Stack<TagHelperScopeInfo> TagHelperScopes { get; } = new Stack<TagHelperScopeInfo>();
Microsoft.AspNetCore.Routing (2)
Tree\LinkGenerationDecisionTree.cs (1)
229var branchStack = new Stack<string>();
Tree\TreeEnumerator.cs (1)
18_stack = new Stack<UrlMatchingNode>();
Microsoft.AspNetCore.Server.IIS (3)
Core\IISHttpContext.cs (2)
684_onStarting = new Stack<KeyValuePair<Func<object, Task>, object>>(); 696_onCompleted = new Stack<KeyValuePair<Func<object, Task>, object>>();
src\Shared\RazorViews\BaseView.cs (1)
23private readonly Stack<TextWriter> _textWriterStack = new Stack<TextWriter>();
Microsoft.AspNetCore.Server.Kestrel.Core (3)
Internal\Http\HttpProtocol.cs (2)
791_onStarting = new Stack<KeyValuePair<Func<object, Task>, object>>(); 800_onCompleted = new Stack<KeyValuePair<Func<object, Task>, object>>();
Internal\Infrastructure\KestrelConnection.cs (1)
84_onCompleted = new Stack<KeyValuePair<Func<object, Task>, object>>();
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
src\Shared\test\Shared.Tests\runtime\Http2\DynamicTableTest.cs (1)
106Stack<byte[]> insertedHeaders = new Stack<byte[]>();
Microsoft.AspNetCore.Shared.Tests (1)
runtime\Http2\DynamicTableTest.cs (1)
106Stack<byte[]> insertedHeaders = new Stack<byte[]>();
Microsoft.AspNetCore.SignalR.Client.Core (1)
src\SignalR\common\Shared\MessageBuffer.cs (1)
53private readonly Stack<LinkedBuffer> _pool = new();
Microsoft.AspNetCore.SignalR.Core (1)
src\SignalR\common\Shared\MessageBuffer.cs (1)
53private readonly Stack<LinkedBuffer> _pool = new();
Microsoft.Build (11)
BackEnd\Components\RequestBuilder\TargetEntry.cs (1)
761_legacyCallTargetScopes = new Stack<Lookup.Scope>();
BackEnd\Components\Scheduler\SchedulableRequest.cs (1)
525Stack<SchedulableRequest> requestsToEvaluate = new Stack<SchedulableRequest>(16);
BackEnd\Components\Scheduler\Scheduler.cs (1)
1686Stack<BuildRequest> requestsToAdd = new Stack<BuildRequest>(blocker.BuildRequests.Length);
BackEnd\Components\Scheduler\SchedulingPlan.cs (2)
290Stack<PlanConfigData> currentPath = new Stack<PlanConfigData>(); 309Stack<PlanConfigData> pathToAdd = new Stack<PlanConfigData>(currentPath);
Evaluation\Expander.cs (1)
2138Stack<TransformFunction<S>> transformFunctionStack = new Stack<TransformFunction<S>>(match.Captures.Count);
Evaluation\LazyItemEvaluator.cs (2)
320Stack<LazyItemList> itemListStack = new Stack<LazyItemList>(); 343globsToIgnoreStack ??= new Stack<ImmutableHashSet<string>>();
Evaluation\Preprocessor.cs (1)
42private readonly Stack<string> _filePaths = new Stack<string>();
Evaluation\Profiler\EvaluationProfiler.cs (1)
22private readonly Stack<EvaluationFrame> _evaluationStack = new Stack<EvaluationFrame>();
Logging\SerialConsoleLogger.cs (1)
920_frames = new Stack<Frame>();
Microsoft.Build.Tasks.Core (1)
ParserState.cs (1)
22private readonly Stack<string> _namespaceStack = new Stack<string>();
Microsoft.Cci.Extensions (2)
HostEnvironment.cs (1)
687Stack<string> unexpandedPaths = new Stack<string>(paths);
Traversers\DependencyTraverser.cs (1)
24_definitionStack = new Stack<IDefinition>();
Microsoft.CodeAnalysis (15)
CodeGen\LocalScopeManager.cs (1)
31_scopes = new Stack<ScopeInfo>(1);
Collections\KeyedStack.cs (1)
25store = new Stack<R>();
Collections\Rope.cs (3)
130var stack = new Stack<Rope>(); 159var stack = new Stack<Rope>(); 185var stack = new Stack<Rope>();
Collections\SmallDictionary.cs (3)
534_stack = new Stack<AvlNode>(dict.HeightApprox()); 652_stack = new Stack<AvlNode>(dict.HeightApprox()); 758_stack = new Stack<AvlNode>(dict.HeightApprox());
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithSimpleName.cs (2)
31private static readonly ObjectPool<Stack<string>> s_stringStackPool = new ObjectPool<Stack<string>>(static () => new Stack<string>()); 32private static readonly ObjectPool<Stack<SyntaxNode>> s_nodeStackPool = new ObjectPool<Stack<SyntaxNode>>(static () => new Stack<SyntaxNode>());
Syntax\SyntaxDiffer.cs (2)
19private readonly Stack<SyntaxNodeOrToken> _oldNodes = new Stack<SyntaxNodeOrToken>(InitialStackSize); 20private readonly Stack<SyntaxNodeOrToken> _newNodes = new Stack<SyntaxNodeOrToken>(InitialStackSize);
Syntax\SyntaxNavigator.cs (2)
93= new ObjectPool<Stack<ChildSyntaxList.Enumerator>>(() => new Stack<ChildSyntaxList.Enumerator>(), 10); 139= new ObjectPool<Stack<ChildSyntaxList.Reversed.Enumerator>>(() => new Stack<ChildSyntaxList.Reversed.Enumerator>(), 10);
TreeDumper.cs (1)
260var stack = new Stack<KeyValuePair<TreeDumperNode?, TreeDumperNode>>();
Microsoft.CodeAnalysis.CodeStyle (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\IntervalTreeHelpers.cs (1)
37private static readonly ObjectPool<Stack<TNode>> s_nodeStackPool = new(() => new(), 128, trimOnFree: false);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
44var stack = new Stack<INamedTypeSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
852private static readonly ObjectPool<Stack<TDirectiveTriviaSyntax>> s_stackPool = new(() => new());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
332private readonly Stack<ISymbol?> _contextualSymbolStack = new();
Microsoft.CodeAnalysis.CSharp (9)
Binder\Binder.QueryTranslationState.cs (1)
37public readonly Stack<QueryClauseSyntax> clauses = new Stack<QueryClauseSyntax>();
Compilation\SyntaxAndDeclarationManager.cs (1)
23new ObjectPool<Stack<SingleNamespaceOrTypeDeclaration>>(() => new Stack<SingleNamespaceOrTypeDeclaration>());
Compiler\DocumentationCommentCompiler.cs (1)
1232_temporaryStringBuilders = new Stack<TemporaryStringBuilder>();
Declarations\DeclarationTable.cs (2)
216var stack = new Stack<Declaration>(); 321var stack = new Stack<MergedNamespaceOrTypeDeclaration>();
Emitter\Model\PEModuleBuilder.cs (2)
340var namespacesAndTypesToProcess = new Stack<NamespaceOrTypeSymbol>(); 561var namespacesToProcess = new Stack<NamespaceSymbol>();
Symbols\TypeParameterSymbolExtensions.cs (1)
32stack ??= new Stack<TypeParameterSymbol>();
Syntax\SyntaxEquivalence.cs (1)
17new ObjectPool<Stack<(GreenNode?, GreenNode?)>>(() => new Stack<(GreenNode?, GreenNode?)>());
Microsoft.CodeAnalysis.CSharp.Features (3)
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
961Stack = new Stack<CSharpSyntaxNode>();
DecompiledSource\CSharpDecompiledSourceService.cs (2)
109var containingTypeStack = new Stack<string>(); 110var containingNamespaceStack = new Stack<string>();
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
ObjectFormatterTests.cs (1)
571var obj = new Stack<int>();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\LookupPositionTests.cs (1)
3139Stack<string[]> stack = new Stack<string[]>();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\AnonymousTypesSemanticsTests.cs (1)
2053var stack = new Stack<SyntaxNode>();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Parsing\ParsingTests.cs (1)
262var stack = new Stack<ChildSyntaxList.Enumerator>(24);
Microsoft.CodeAnalysis.EditorFeatures (2)
InlineRename\AbstractInlineRenameUndoManager.cs (2)
34protected readonly Stack<ActiveSpanState> UndoStack = new Stack<ActiveSpanState>(); 35protected readonly Stack<ActiveSpanState> RedoStack = new Stack<ActiveSpanState>();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
Extensions\CollectionExtensionsTest.cs (3)
19var stack = new Stack<int>(); 30var stack = new Stack<int>(); 38var stack = new Stack<int>();
Microsoft.CodeAnalysis.Features (5)
DocumentationComments\AbstractDocumentationCommentFormattingService.cs (2)
67private readonly Stack<(string target, string hint)> _navigationTargetStack = new(); 74private readonly Stack<TaggedTextStyle> _styleStack = new();
ExtractMethod\MethodExtractor.TriviaResult.cs (1)
136var stack = new Stack<SyntaxTrivia>();
Shared\Utilities\ExtractTypeHelpers.cs (1)
167var typesToVisit = new Stack<INamedTypeSymbol>();
ValueTracking\ValueTrackingProgressCollector.cs (1)
16private readonly Stack<ValueTrackedItem> _items = new();
Microsoft.CodeAnalysis.Test.Utilities (3)
Assert\AssertXml.cs (1)
154Stack<Tuple<XElement, XElement>> stack = new Stack<Tuple<XElement, XElement>>();
MarkedSource\MarkupTestFile.cs (2)
65var spanStartStack = new Stack<(int matchIndex, string name)>(); 66var namedSpanStartStack = new Stack<(int matchIndex, string name)>();
Microsoft.CodeAnalysis.VisualBasic (2)
Compilation\DocumentationComments\DocWriter.vb (1)
136Me._temporaryStringBuilders = New Stack(Of TemporaryStringBuilder)()
Lowering\Diagnostics\DiagnosticsPass.vb (1)
171_expressionsBeingVisited = New Stack(Of BoundExpression)()
Microsoft.CodeAnalysis.Workspaces (9)
Classification\SyntaxClassification\AbstractSyntaxClassificationService.Worker.cs (1)
32private static readonly ObjectPool<Stack<SyntaxNodeOrToken>> s_stackPool = new(() => new(), trimOnFree: false);
Classification\SyntaxClassification\SyntacticChangeRangeComputer.cs (2)
38private static readonly ObjectPool<Stack<ChildSyntaxList.Enumerator>> s_enumeratorPool = new(() => new()); 39private static readonly ObjectPool<Stack<ChildSyntaxList.Reversed.Enumerator>> s_reversedEnumeratorPool = new(() => new());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\IntervalTreeHelpers.cs (1)
37private static readonly ObjectPool<Stack<TNode>> s_nodeStackPool = new(() => new(), 128, trimOnFree: false);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (1)
44var stack = new Stack<INamedTypeSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (1)
852private static readonly ObjectPool<Stack<TDirectiveTriviaSyntax>> s_stackPool = new(() => new());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
332private readonly Stack<ISymbol?> _contextualSymbolStack = new();
Storage\SQLite\v2\SQLitePersistentStorage.cs (1)
39private readonly Stack<SqlConnection> _connectionsPool = new();
Storage\SQLite\v2\SQLitePersistentStorage_Helpers.cs (1)
89private static readonly Stack<byte[]> s_byteArrayPool = new();
Microsoft.DotNet.AsmDiff (4)
ApiRecordingCSharpDiffWriter.cs (2)
18private Stack<List<DiffApiDefinition>> _apiStack = new Stack<List<DiffApiDefinition>>(); 19private Stack<DiffApiDefinition> _apiDefinitionStack = new Stack<DiffApiDefinition>();
DiffEngine.cs (1)
204var startLineStack = new Stack<DiffLine>();
DiffRecorder.cs (1)
14private Stack<DiffStyle> _styleStack = new Stack<DiffStyle>();
Microsoft.DotNet.PackageTesting (2)
VerifyClosure.cs (2)
167var depStack = new Stack<AssemblyInfo>(); 258var depStack = new Stack<AssemblyInfo>();
Microsoft.DotNet.SharedFramework.Sdk (2)
src\Microsoft.DotNet.PackageTesting\VerifyClosure.cs (2)
167var depStack = new Stack<AssemblyInfo>(); 258var depStack = new Stack<AssemblyInfo>();
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (4)
Modeler\ServiceClientModelFactory.cs (4)
51_typeNameStack.Value = new Stack<string>(); 52_propertyNameStack.Value = new Stack<string>(); 53_parameterNameStack.Value = new Stack<string>(); 54_methodNameStack.Value = new Stack<string>();
Microsoft.DotNet.VersionTools (1)
BuildManifest\VersionIdentifier.cs (1)
96Stack<(int versionNumber, int index)> majorMinorPatchStack = new Stack<(int,int)>(3);
Microsoft.Extensions.Configuration (1)
ConfigurationSectionDebugView.cs (1)
47var stack = new Stack<IConfiguration>();
Microsoft.Extensions.Configuration.Abstractions (1)
ConfigurationExtensions.cs (1)
56var stack = new Stack<IConfiguration>();
Microsoft.Extensions.Configuration.Json (1)
JsonConfigurationFileParser.cs (1)
17private readonly Stack<string> _paths = new Stack<string>();
Microsoft.Extensions.Configuration.Xml (2)
XmlStreamConfigurationProvider.cs (2)
54var currentPath = new Stack<XmlConfigurationElement>(); 425_lengths = new Stack<int>();
Microsoft.Extensions.FileSystemGlobbing (1)
Internal\PatternContexts\PatternContext.cs (1)
12private readonly Stack<TFrame> _stack = new();
Microsoft.Extensions.Identity.Core (1)
TokenProviderDescriptor.cs (1)
16private readonly Stack<Type> _providerTypes = new(1);
Microsoft.Extensions.SecretManager.Tools.Tests (1)
UserSecretsTestFixture.cs (1)
13private Stack<Action> _disposables = new Stack<Action>();
Microsoft.Gen.ComplianceReports (1)
Emitter.cs (1)
15private readonly Stack<int> _itemCounts = new();
Microsoft.Gen.Logging (2)
Emission\StringBuilderPool.cs (1)
11private readonly Stack<StringBuilder> _builders = new();
src\Generators\Shared\StringBuilderPool.cs (1)
16private readonly Stack<StringBuilder> _builders = new();
Microsoft.Gen.Metrics (1)
src\Generators\Shared\StringBuilderPool.cs (1)
16private readonly Stack<StringBuilder> _builders = new();
Microsoft.Gen.MetricsReports (1)
src\Generators\Shared\StringBuilderPool.cs (1)
16private readonly Stack<StringBuilder> _builders = new();
Microsoft.Interop.SourceGeneration (3)
ManualTypeMarshallingHelper.cs (1)
362Stack<ITypeSymbol> typeStack = new();
TypeSymbolExtensions.cs (2)
229Stack<INamedTypeSymbol> originalNestedTypes = new(); 309Stack<(ImmutableArray<ITypeSymbol>, ImmutableArray<NullableAnnotation>)> genericTypesToSubstitute = new();
Microsoft.Maui.Controls (2)
Compatibility\Handlers\TableView\iOS\TableViewRenderer.cs (1)
40 var viewsToLookAt = new Stack<UIView>(Subviews);
Profiler.cs (1)
51 Stack = new Stack<Profile>(Capacity);
Microsoft.Maui.Graphics (4)
AbstractCanvas.cs (1)
14 private readonly Stack<TState> _stateStack = new Stack<TState>();
PathBuilder.cs (1)
20 private readonly Stack<string> _commandStack = new Stack<string>();
ScalingCanvas.cs (2)
13 private readonly Stack<float> _scaleXStack = new Stack<float>(); 14 private readonly Stack<float> _scaleYStack = new Stack<float>();
Microsoft.Maui.Graphics.Text.Markdig (1)
Renderer\HtmlInlineRenderer.cs (1)
10 private Stack<SpanData> _spans = new Stack<SpanData>();
Microsoft.ML.Core (1)
Utilities\Utils.cs (1)
177stack = new Stack<T>();
Microsoft.ML.Data (2)
Prediction\Calibrator.cs (1)
1882Stack<Piece> stack = new Stack<Piece>();
Utilities\StreamUtils.cs (1)
93var dirsLeft = new Stack<string>();
Microsoft.ML.TorchSharp (1)
AutoFormerV2\ObjectDetectionMetrics.cs (1)
260Stack<Tuple<float, float>> prStack = new(); // precision and recall * groundTruthBoxesNum (= true positive)
Microsoft.VisualStudio.LanguageServices (1)
ProjectSystem\Legacy\AbstractLegacyProject_IProjectSiteEx.cs (1)
18private readonly Stack<ProjectSystemProject.BatchScope> _batchScopes = new();
PresentationBuildTasks (2)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\MarkupExtensionParser.cs (1)
928Stack<char> bracketCharacterStack = new Stack<char>();
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\StyleModeStack.cs (1)
68private Stack<StyleMode> _stack = new Stack<StyleMode>(64);
PresentationCore (10)
MS\Internal\TextFormatting\TextStore.cs (1)
2688Stack<TextModifier> directionalEmbeddingStack = new Stack<TextModifier>(32);
MS\Internal\UIElementHelper.cs (1)
142Stack<DependencyObject> branchNodeStack = new Stack<DependencyObject>();
System\Windows\EventRoute.cs (1)
306(_branchNodeStack ??= new Stack<BranchNode>(1)).Push(branchNode);
System\Windows\Media\BoundsDrawingContextWalker.cs (3)
344_clipStack = new Stack<Rect>(2); 398_transformStack = new Stack<Matrix>(2); 613_pushTypeStack = new Stack<PushType>(2);
System\Windows\Media\DrawingDrawingContext.cs (1)
1341_previousDrawingGroupStack = new Stack<DrawingGroup>(2);
System\Windows\Media\Generated\RenderData.cs (1)
545Stack<PushType> pushStack = new Stack<PushType>();
System\Windows\Media\HitTestWithPointDrawingContextWalker.cs (1)
318_pointStack = new Stack<Point>(2);
System\Windows\Media3D\Viewport2DVisual3D.cs (1)
462Stack<Material> materialStack = new Stack<Material>();
PresentationFramework (24)
MS\Internal\Annotations\Anchoring\LocatorManager.cs (1)
1311private Stack<bool> _calledProcessAnnotations = new Stack<bool>();
MS\Internal\Data\LiveShapingBlock.cs (2)
310Stack<LiveShapingBlock> stack = new Stack<LiveShapingBlock>(list); 391Stack<LiveShapingBlock> stack = new Stack<LiveShapingBlock>(list);
MS\Internal\Globalization\BamlResourceDeserializer.cs (2)
361stackForProperty = new Stack<ILocalizabilityInheritable>(); 396private Stack<BamlTreeNode> _bamlTreeStack = new Stack<BamlTreeNode>();
MS\Internal\Globalization\BamlResourceSerializer.cs (1)
56_bamlTreeStack = new Stack<BamlTreeNode>();
MS\Internal\Ink\EditingCoordinator.cs (1)
43_activationStack = new Stack<EditingBehavior>(2);
MS\Internal\PtsHost\StructuralCache.cs (2)
782private Stack<DocumentFormatInfo> _documentFormatInfoStack = new Stack<DocumentFormatInfo>(); 859private Stack<DocumentArrangeInfo> _documentArrangeInfoStack = new Stack<DocumentArrangeInfo>();
System\Windows\Application.cs (1)
546s_NestedBamlLoadInfo = new Stack<NestedBamlLoadInfo>();
System\Windows\Controls\InkCanvas.cs (1)
278Stack<Transform> transforms = new Stack<Transform>();
System\Windows\Diagnostics\ResourceDictionaryDiagnostics.cs (1)
344_lookupResultStack = new Stack<LookupResult>();
System\Windows\Documents\TextRangeBase.cs (2)
801listItemCounter = new Stack<int>(1); 832listItemCounter = new Stack<int>(1);
System\Windows\Documents\TextStore.cs (1)
4882private Stack<IMECompositionTraceOp> _opStack = new Stack<IMECompositionTraceOp>();
System\Windows\Documents\XPSS0ValidatingLoader.cs (1)
218static private Stack<Hashtable> _validResources = new Stack<Hashtable>();
System\Windows\Markup\Baml2006\Baml2006Reader.cs (1)
32private Stack<XamlWriter> _xamlWriterStack = new Stack<XamlWriter>();
System\Windows\Markup\BamlReader.cs (4)
175_nodeStack = new Stack<BamlNodeInfo>(); 1440Stack<bool> readProperty = new(); 1441Stack<bool> readConstructor = new(); 1442Stack<bool> readFirstConstructor = new();
System\Windows\Markup\MarkupExtensionParser.cs (1)
928Stack<char> bracketCharacterStack = new Stack<char>();
System\Windows\Markup\StyleModeStack.cs (1)
68private Stack<StyleMode> _stack = new Stack<StyleMode>(64);
System\Windows\TreeChangeInfo.cs (1)
204_inheritablePropertiesStack = new Stack<FrugalObjectList<DependencyProperty>>(1);
ReachFramework (2)
Serialization\Manager\ReachVisualSerializer.cs (1)
97Stack<NodeContext> contextStack = new Stack<NodeContext>();
Serialization\Manager\ReachVisualSerializerAsync.cs (1)
125Stack<NodeContext> contextStack = new Stack<NodeContext>();
RunTests (1)
TestRunner.cs (1)
329var waiting = new Stack<WorkItemInfo>(workItems);
Stress.ApiService (1)
TraceCreator.cs (1)
37var activityStack = new Stack<Activity>();
System.CodeDom (1)
src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (1)
175var subTypeNames = new Stack<string>();
System.Collections (4)
System\Collections\Generic\SortedSet.cs (3)
194var stack = new Stack<Node>(2 * (int)Log2(Count + 1)); 1635var pendingNodes = new Stack<(Node source, Node target)>(2 * Log2(count) + 2); 1854_stack = new Stack<Node>(2 * (int)Log2(set.TotalCount() + 1));
System\Collections\Generic\SortedSet.TreeSubSet.cs (1)
196Stack<Node> stack = new Stack<Node>(2 * (int)SortedSet<T>.Log2(count + 1)); // this is not exactly right if count is out of date, but the stack can grow
System.Collections.Immutable (5)
System\Collections\Immutable\AllocFreeConcurrentStack.cs (1)
24t_stack ??= new Stack<RefAsValueType<T>>(MaxSize);
System\Collections\Immutable\ImmutableList_1.Enumerator.cs (1)
109_stack = SecureObjectPool<Stack<RefAsValueType<Node>>, Enumerator>.PrepNew(this, new Stack<RefAsValueType<Node>>(root.Height));
System\Collections\Immutable\ImmutableSortedDictionary_2.Enumerator.cs (1)
78_stack = SecureObjectPool<Stack<RefAsValueType<Node>>, Enumerator>.PrepNew(this, new Stack<RefAsValueType<Node>>(root.Height));
System\Collections\Immutable\ImmutableSortedSet_1.Enumerator.cs (1)
90_stack = SecureObjectPool<Stack<RefAsValueType<Node>>, Enumerator>.PrepNew(this, new Stack<RefAsValueType<Node>>(root.Height));
System\Collections\Immutable\SortedInt32KeyNode.Enumerator.cs (1)
64_stack = SecureObjectPool<Stack<RefAsValueType<SortedInt32KeyNode<TValue>>>, Enumerator>.PrepNew(this, new Stack<RefAsValueType<SortedInt32KeyNode<TValue>>>(root.Height));
System.ComponentModel.Composition (3)
Microsoft\Internal\Collections\CollectionServices.cs (1)
204return new Stack<T>(stack.Reverse());
System\ComponentModel\Composition\CompositionException.cs (1)
268context.Path = new Stack<CompositionError>();
System\ComponentModel\Composition\Hosting\ImportEngine.cs (1)
24private readonly Stack<PartManager> _recursionStateStack = new Stack<PartManager>();
System.Composition.Hosting (1)
System\Composition\Hosting\Core\ExportDescriptorRegistryUpdate.cs (1)
40var checking = new Stack<CompositionDependency>();
System.Console (3)
System\IO\StdInReader.cs (2)
23private readonly Stack<ConsoleKeyInfo> _tmpKeys = new Stack<ConsoleKeyInfo>(); // temporary working stack; should be empty outside of ReadLine 24private readonly Stack<ConsoleKeyInfo> _availableKeys = new Stack<ConsoleKeyInfo>(); // a queue of already processed key infos available for reading
System\TermInfo.cs (1)
69t_cachedStack = stack = new Stack<FormatParam>();
System.Data.Common (2)
System\Data\XmlDataLoader.cs (2)
49_childRowsStack = new Stack<DataRow>(50); 77_childRowsStack = new Stack<DataRow>(50);
System.Formats.Asn1 (3)
System\Formats\Asn1\AsnDecoder.BitString.cs (1)
544readerStack ??= new Stack<(int, int, bool, int)>();
System\Formats\Asn1\AsnDecoder.OctetString.cs (1)
409readerStack ??= new Stack<(int, int, bool, int)>();
System\Formats\Asn1\AsnWriter.cs (1)
572_nestingStack ??= new Stack<StackFrame>();
System.Formats.Cbor (5)
System\Formats\Cbor\Reader\CborReader.cs (1)
176_nestedDataItems ??= new Stack<StackFrame>();
System\Formats\Cbor\Reader\CborReader.Map.cs (1)
193_pooledKeyEncodingRangeAllocations ??= new Stack<HashSet<(int Offset, int Length)>>();
System\Formats\Cbor\Writer\CborWriter.cs (1)
260_nestedDataItems ??= new Stack<StackFrame>();
System\Formats\Cbor\Writer\CborWriter.Map.cs (2)
207_pooledKeyEncodingRangeSets ??= new Stack<HashSet<(int Offset, int Length)>>(); 234_pooledKeyValuePairEncodingRangeLists ??= new Stack<List<KeyValuePairEncodingRange>>();
System.Formats.Nrbf (1)
System\Formats\Nrbf\NrbfDecoder.cs (1)
162Stack<NextInfo> readStack = new();
System.Formats.Tar (2)
System\Formats\Tar\TarFile.cs (2)
461var directoryModificationTimes = new Stack<(string, DateTimeOffset)>(); 503var directoryModificationTimes = new Stack<(string, DateTimeOffset)>();
System.Linq.Expressions (10)
System\Dynamic\BindingRestrictions.cs (3)
146private readonly Stack<AndNode> _tests = new Stack<AndNode>(); 212var stack = new Stack<BindingRestrictions>(); 365var stack = new Stack<BindingRestrictions>();
System\Linq\Expressions\Compiler\KeyedStack.cs (1)
20_data.Add(key, stack = new Stack<TValue>());
System\Linq\Expressions\Compiler\StackSpiller.Temps.cs (1)
146_usedTemps ??= new Stack<ParameterExpression>();
System\Linq\Expressions\Compiler\VariableBinder.cs (2)
20private readonly Stack<CompilerScope> _scopes = new Stack<CompilerScope>(); 21private readonly Stack<BoundConstants> _constants = new Stack<BoundConstants>();
System\Linq\Expressions\Interpreter\LightCompiler.cs (1)
288private readonly Stack<ParameterExpression> _exceptionForRethrowStack = new Stack<ParameterExpression>();
System\Linq\Expressions\Interpreter\TypeOperations.cs (1)
505private readonly Stack<HashSet<ParameterExpression>> _shadowedVars = new Stack<HashSet<ParameterExpression>>();
System\Runtime\CompilerServices\RuntimeOps.ExpressionQuoter.cs (1)
60private readonly Stack<HashSet<ParameterExpression>> _shadowedVars = new Stack<HashSet<ParameterExpression>>();
System.Private.CoreLib.Generators (2)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (2)
400Stack<INamedTypeSymbol> symbolsToExamine = new Stack<INamedTypeSymbol>(); 428Stack<INamedTypeSymbol> symbolsToExamine = new Stack<INamedTypeSymbol>();
System.Private.DataContractSerialization (2)
src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (1)
175var subTypeNames = new Stack<string>();
System\Runtime\Serialization\CodeGenerator.cs (1)
145_blockStack = new Stack<object>();
System.Private.Xml (22)
System\Xml\Cache\XPathDocumentBuilder.cs (1)
72_stkNmsp = new Stack<XPathNodeRef>();
System\Xml\Schema\ContentValidator.cs (5)
439Stack<InteriorNode> nodeStack = new Stack<InteriorNode>(); 494Stack<SequenceConstructPosContext> contextStack = new Stack<SequenceConstructPosContext>(); 569Stack<SequenceNode> nodeStack = new Stack<SequenceNode>(); 652Stack<ChoiceNode> nodeStack = new Stack<ChoiceNode>(); 1081_stack = new Stack<SyntaxTreeNode?>();
System\Xml\Schema\DtdParser.cs (1)
1030Stack<ParseElementOnlyContent_LocalFrame> localFrames = new Stack<ParseElementOnlyContent_LocalFrame>();
System\Xml\Schema\DtdParserAsync.cs (1)
661Stack<ParseElementOnlyContent_LocalFrame> localFrames = new Stack<ParseElementOnlyContent_LocalFrame>();
System\Xml\Schema\SchemaCollectionCompiler.cs (1)
17private readonly Stack<XmlSchemaComplexType> _complexTypeStack = new Stack<XmlSchemaComplexType>();
System\Xml\Schema\SchemaSetCompiler.cs (1)
25private readonly Stack<XmlSchemaComplexType> _complexTypeStack = new Stack<XmlSchemaComplexType>();
System\Xml\Schema\XsdBuilder.cs (1)
630private readonly Stack<XmlSchemaObject> _containerStack = new Stack<XmlSchemaObject>();
System\Xml\Serialization\CodeGenerator.cs (3)
90_blockStack = new Stack<object>(); 91_whileStack = new Stack<WhileState>(); 377private readonly Stack<Label> _leaveLabels = new Stack<Label>();
System\Xml\XPath\Internal\PreSiblingQuery.cs (1)
49Stack<XPathNavigator> inputStk = new Stack<XPathNavigator>();
System\Xml\Xsl\Runtime\XmlQueryOutput.cs (1)
1542_stkNames ??= new Stack<string>(15);
System\Xml\Xsl\Runtime\XmlQueryRuntime.cs (1)
146_stkOutput = new Stack<XmlQueryOutput>(16);
System\Xml\Xsl\XPath\XPathParser.cs (1)
14private readonly Stack<int> _posInfo = new Stack<int>();
System\Xml\Xsl\Xslt\InvokeGenerator.cs (1)
37_iterStack = new Stack<QilIterator>();
System\Xml\Xsl\Xslt\QilGenerator.cs (1)
2854private readonly Stack<QilIterator> _vars = new Stack<QilIterator>();
System\Xml\Xsl\Xslt\XslAstAnalyzer.cs (1)
1245_newTemplates = new Stack<Template>();
System\Xml\Xsl\XsltOld\Compiler.cs (1)
647_stylesheets ??= new Stack<Stylesheet>();
System.Text.Json (1)
System\Text\Json\Serialization\IgnoreReferenceResolver.cs (1)
27_stackForCycleDetection ??= new Stack<ReferenceEqualsWrapper>();
System.Text.RegularExpressions (7)
System\Text\RegularExpressions\RegexCompiler.cs (2)
352_int32LocalsPool ??= new Stack<LocalBuilder>(), 361_readOnlySpanCharLocalsPool ??= new Stack<LocalBuilder>(1), // capacity == 1 as we currently don't expect overlapping instances
System\Text\RegularExpressions\RegexNode.cs (1)
205var toExamine = new Stack<RegexNode>();
System\Text\RegularExpressions\Symbolic\BDD.cs (2)
250var toVisit = new Stack<BDD>(); 457var toVisit = new Stack<BDD>();
System\Text\RegularExpressions\Symbolic\MintermGenerator.cs (1)
92var stack = new Stack<PartitionTree>();
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (1)
37Stack<(RegexNode Node, DoublyLinkedList<SymbolicRegexNode<BDD>> Result, DoublyLinkedList<SymbolicRegexNode<BDD>>[]? ChildResults)> stack = new();
System.Text.RegularExpressions.Generator (2)
RegexGenerator.Emitter.cs (1)
46var parentClasses = new Stack<string>();
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (1)
205var toExamine = new Stack<RegexNode>();
System.Windows.Controls.Ribbon (1)
Microsoft\Windows\Controls\KeyTipService.cs (1)
1756private Stack<DependencyObject> _scopeStack = new Stack<DependencyObject>();
System.Windows.Forms (4)
System\Windows\Forms\Controls\ToolStrips\MergeHistory.cs (1)
16=> _mergeHistoryItemsStack ??= new Stack<MergeHistoryItem>();
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (1)
1333_mergeHistoryStack ??= new Stack<MergeHistory>();
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (1)
766Stack<ToolStripDropDownItem> itemsStack = new();
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (1)
1304Stack<ToolStrip> reApply = new();
System.Windows.Forms.Design (4)
System\ComponentModel\Design\DesignerHost.DesignerHostTransaction.cs (1)
18_host._transactions ??= new Stack<DesignerTransaction>();
System\ComponentModel\Design\UndoEngine.cs (1)
39_unitStack = new Stack<UndoUnit>();
System\Windows\Forms\Design\Behavior\BehaviorService.MenuCommandHandler.cs (1)
13private readonly Stack<CommandID> _currentCommands = new();
System\Windows\Forms\Design\TabOrder.cs (1)
56_controlIndices = new Stack<int>();
System.Xaml (8)
System\Xaml\Parser\GenericTypeNameParser.cs (1)
255_stack = new Stack<TypeNameFrame>();
System\Xaml\Parser\MeScanner.cs (1)
606BracketCharacterStack = new Stack<char>();
System\Xaml\Parser\XamlScannerStack.cs (1)
32_stack = new Stack<XamlScannerFrame>();
System\Xaml\XamlMarkupExtensionWriter.cs (1)
39nodes = new Stack<Node>();
System\Xaml\XamlObjectReader.cs (2)
49nodes = new Stack<MarkupInfo>(); 73Stack<HashSet<string>> namesInCurrentScope = new Stack<HashSet<string>>();
System\Xaml\XamlXmlWriter.cs (2)
105namespaceScopes = new Stack<Frame>(); 109meNodesStack = new Stack<List<XamlNode>>();
xunit.console (1)
CommandLine.cs (1)
13readonly Stack<string> arguments = new Stack<string>();
672 references to Stack
ConfigurationSchemaGenerator (1)
ConfigSchemaEmitter.cs (1)
36private readonly Stack<TypeSpec> _visitedTypes = new();
DesignSurfaceExt (2)
UndoEngineExt.cs (2)
10private readonly Stack<UndoUnit> _undoStack = new(); 11private readonly Stack<UndoUnit> _redoStack = new();
dotnet-svcutil-lib (12)
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathDocumentBuilder.cs (1)
41private Stack<XPathNodeRef> _stkNmsp; // In-scope namespaces
FrameworkFork\Microsoft.Xml\Xml\schema\ContentValidator.cs (4)
482Stack<InteriorNode> nodeStack = new Stack<InteriorNode>(); 542Stack<SequenceConstructPosContext> contextStack = new Stack<SequenceConstructPosContext>(); 643Stack<SequenceNode> nodeStack = new Stack<SequenceNode>(); 727Stack<ChoiceNode> nodeStack = new Stack<ChoiceNode>();
FrameworkFork\Microsoft.Xml\Xml\schema\DtdParser.cs (1)
1042Stack<ParseElementOnlyContent_LocalFrame> localFrames = new Stack<ParseElementOnlyContent_LocalFrame>();
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\precedingsibling.cs (1)
52Stack<XPathNavigator> inputStk = new Stack<XPathNavigator>();
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeGenerator.cs (1)
161private Stack<object> _blockStack;
FrameworkFork\System.ServiceModel\Internals\System\Runtime\InternalBufferManager.cs (1)
459private Stack<byte[]> _items;
FrameworkFork\System.ServiceModel\Internals\System\Runtime\SynchronizedPool.cs (1)
346private Stack<T> _items;
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MetadataExchangeClient.cs (2)
457private Stack<MetadataRetriever> _stackedRetrievers; 478internal Stack<MetadataRetriever> StackedRetrievers
Identity.DefaultUI.WebSite (1)
StartupBase.cs (1)
87var pendingProviders = new Stack<IFileProvider>();
illink (43)
ILLink.Tasks (1)
CreateRuntimeRootDescriptorFile.cs (1)
494 readonly Stack<bool?> activeSections = new Stack<bool?> ();
InMemory.FunctionalTests (5)
ResponseTests.cs (2)
3318var callOrder = new Stack<int>(); 3369var callOrder = new Stack<int>();
src\Servers\Kestrel\shared\ConnectionCompletion.cs (3)
12public static Task FireOnCompletedAsync(ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>>? onCompleted) 22private static Task CompleteAsyncMayAwait(ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted) 43private static async Task CompleteAsyncAwaited(Task currentTask, ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted)
Microsoft.AspNetCore.App.Analyzers.Test (3)
RouteEmbeddedLanguage\Infrastructure\MarkupTestFile.cs (3)
65var spanStartStack = new Stack<(int matchIndex, string name)>(); 66var namedSpanStartStack = new Stack<(int matchIndex, string name)>(); 190Stack<(int matchIndex, string name)> spanStartStack,
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (1)
UserJwtsTestFixture.cs (1)
11private readonly Stack<Action> _disposables = new();
Microsoft.AspNetCore.Components (2)
Rendering\RenderTreeBuilder.cs (1)
26private readonly Stack<int> _openElementIndices = new Stack<int>();
src\Http\Routing\src\Tree\TreeEnumerator.cs (1)
13private readonly Stack<UrlMatchingNode> _stack;
Microsoft.AspNetCore.Components.Endpoints (12)
FormMapping\Converters\CollectionAdapters\StackBufferAdapter.cs (7)
6internal sealed class StackBufferAdapter<TElement> : ICollectionBufferAdapter<Stack<TElement>, Stack<TElement>, TElement> 8public static Stack<TElement> CreateBuffer() => new(); 10public static Stack<TElement> Add(ref Stack<TElement> buffer, TElement element) 16public static Stack<TElement> ToResult(Stack<TElement> buffer) => buffer;
FormMapping\Factories\Collections\TypedCollectionConverterFactory.cs (4)
47var _ when type == (typeof(Stack<TElement>)) => true, 135var _ when type.IsAssignableTo(typeof(Stack<TElement>)) => 136new CollectionConverter<Stack<TElement>, StackBufferAdapter<TElement>, Stack<TElement>, TElement>(elementTypeConverter),
Rendering\EndpointHtmlRenderer.EventDispatch.cs (1)
190Stack<string> stack = new();
Microsoft.AspNetCore.Components.Endpoints.Tests (3)
Binding\FormDataMapperTests.cs (3)
777var expected = new Stack<int>(new[] { 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }); 778CanDeserialize_Collection<Stack<int>, Stack<int>, int>(expected);
Microsoft.AspNetCore.Components.Server (2)
BlazorPack\SequenceOfT.cs (1)
25private readonly Stack<SequenceSegment> segmentPool = new Stack<SequenceSegment>();
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequencePool.cs (1)
40private readonly Stack<Sequence<byte>> pool = new Stack<Sequence<byte>>();
Microsoft.AspNetCore.Diagnostics (1)
src\Shared\RazorViews\BaseView.cs (1)
23private readonly Stack<TextWriter> _textWriterStack = new Stack<TextWriter>();
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (1)
src\Shared\RazorViews\BaseView.cs (1)
23private readonly Stack<TextWriter> _textWriterStack = new Stack<TextWriter>();
Microsoft.AspNetCore.Hosting (1)
src\Shared\RazorViews\BaseView.cs (1)
23private readonly Stack<TextWriter> _textWriterStack = new Stack<TextWriter>();
Microsoft.AspNetCore.Http.Extensions (11)
src\Components\Endpoints\src\FormMapping\Converters\CollectionAdapters\StackBufferAdapter.cs (7)
6internal sealed class StackBufferAdapter<TElement> : ICollectionBufferAdapter<Stack<TElement>, Stack<TElement>, TElement> 8public static Stack<TElement> CreateBuffer() => new(); 10public static Stack<TElement> Add(ref Stack<TElement> buffer, TElement element) 16public static Stack<TElement> ToResult(Stack<TElement> buffer) => buffer;
src\Components\Endpoints\src\FormMapping\Factories\Collections\TypedCollectionConverterFactory.cs (4)
47var _ when type == (typeof(Stack<TElement>)) => true, 135var _ when type.IsAssignableTo(typeof(Stack<TElement>)) => 136new CollectionConverter<Stack<TElement>, StackBufferAdapter<TElement>, Stack<TElement>, TElement>(elementTypeConverter),
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\DefaultModelBindingContext.cs (1)
27private readonly Stack<State> _stack = new Stack<State>();
Microsoft.AspNetCore.Mvc.Razor (2)
RazorPageBase.cs (2)
27private readonly Stack<TextWriter> _textWriterStack = new Stack<TextWriter>(); 142private Stack<TagHelperScopeInfo> TagHelperScopes { get; } = new Stack<TagHelperScopeInfo>();
Microsoft.AspNetCore.Routing (3)
Tree\LinkGenerationDecisionTree.cs (2)
229var branchStack = new Stack<string>(); 236private static void FlattenTree(Stack<string> branchStack, StringBuilder sb, DecisionTreeNode<OutboundMatch> node)
Tree\TreeEnumerator.cs (1)
13private readonly Stack<UrlMatchingNode> _stack;
Microsoft.AspNetCore.Server.IIS (5)
Core\IISHttpContext.cs (4)
48protected Stack<KeyValuePair<Func<object, Task>, object>>? _onStarting; 49protected Stack<KeyValuePair<Func<object, Task>, object>>? _onCompleted; 704Stack<KeyValuePair<Func<object, Task>, object>>? onStarting = null; 728Stack<KeyValuePair<Func<object, Task>, object>>? onCompleted = null;
src\Shared\RazorViews\BaseView.cs (1)
23private readonly Stack<TextWriter> _textWriterStack = new Stack<TextWriter>();
Microsoft.AspNetCore.Server.Kestrel.Core (10)
Internal\Http\HttpProtocol.cs (6)
43private Stack<KeyValuePair<Func<object, Task>, object>>? _onStarting; 44private Stack<KeyValuePair<Func<object, Task>, object>>? _onCompleted; 807var onStarting = _onStarting; 815static async Task ProcessEvents(HttpProtocol protocol, Stack<KeyValuePair<Func<object, Task>, object>> events) 835var onCompleted = _onCompleted; 843static async Task ProcessEvents(HttpProtocol protocol, Stack<KeyValuePair<Func<object, Task>, object>> events)
Internal\Infrastructure\KestrelConnection.cs (4)
15private Stack<KeyValuePair<Func<object, Task>, object>>? _onCompleted; 97var onCompleted = _onCompleted; 107private Task CompleteAsyncMayAwait(Stack<KeyValuePair<Func<object, Task>, object>> onCompleted) 128private async Task CompleteAsyncAwaited(Task currentTask, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
src\Shared\test\Shared.Tests\runtime\Http2\DynamicTableTest.cs (1)
106Stack<byte[]> insertedHeaders = new Stack<byte[]>();
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (3)
src\Servers\Kestrel\shared\ConnectionCompletion.cs (3)
12public static Task FireOnCompletedAsync(ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>>? onCompleted) 22private static Task CompleteAsyncMayAwait(ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted) 43private static async Task CompleteAsyncAwaited(Task currentTask, ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (3)
src\Servers\Kestrel\shared\ConnectionCompletion.cs (3)
12public static Task FireOnCompletedAsync(ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>>? onCompleted) 22private static Task CompleteAsyncMayAwait(ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted) 43private static async Task CompleteAsyncAwaited(Task currentTask, ILogger logger, Stack<KeyValuePair<Func<object, Task>, object>> onCompleted)
Microsoft.AspNetCore.Shared.Tests (1)
runtime\Http2\DynamicTableTest.cs (1)
106Stack<byte[]> insertedHeaders = new Stack<byte[]>();
Microsoft.AspNetCore.SignalR.Client.Core (4)
src\SignalR\common\Shared\MessageBuffer.cs (4)
53private readonly Stack<LinkedBuffer> _pool = new(); 322public void AddMessage(ReadOnlyMemory<byte> hubMessage, long sequenceId, Stack<LinkedBuffer> pool) 363public (LinkedBuffer Buffer, int ReturnCredit) RemoveMessages(long sequenceId, Stack<LinkedBuffer> pool) 368private static (LinkedBuffer Buffer, int ReturnCredit) RemoveMessagesCore(LinkedBuffer linkedBuffer, long sequenceId, Stack<LinkedBuffer> pool)
Microsoft.AspNetCore.SignalR.Core (4)
src\SignalR\common\Shared\MessageBuffer.cs (4)
53private readonly Stack<LinkedBuffer> _pool = new(); 322public void AddMessage(ReadOnlyMemory<byte> hubMessage, long sequenceId, Stack<LinkedBuffer> pool) 363public (LinkedBuffer Buffer, int ReturnCredit) RemoveMessages(long sequenceId, Stack<LinkedBuffer> pool) 368private static (LinkedBuffer Buffer, int ReturnCredit) RemoveMessagesCore(LinkedBuffer linkedBuffer, long sequenceId, Stack<LinkedBuffer> pool)
Microsoft.Build (23)
BackEnd\Components\RequestBuilder\TargetEntry.cs (1)
139private Stack<Lookup.Scope> _legacyCallTargetScopes;
BackEnd\Components\Scheduler\SchedulableRequest.cs (1)
525Stack<SchedulableRequest> requestsToEvaluate = new Stack<SchedulableRequest>(16);
BackEnd\Components\Scheduler\Scheduler.cs (1)
1686Stack<BuildRequest> requestsToAdd = new Stack<BuildRequest>(blocker.BuildRequests.Length);
BackEnd\Components\Scheduler\SchedulingPlan.cs (11)
47private Dictionary<int, List<Stack<PlanConfigData>>> _configIdToPaths = new Dictionary<int, List<Stack<PlanConfigData>>>(); 290Stack<PlanConfigData> currentPath = new Stack<PlanConfigData>(); 298private void RecursiveVisitNodes(PlanConfigData root, Stack<PlanConfigData> currentPath) 301List<Stack<PlanConfigData>> pathsForConfig; 304pathsForConfig = new List<Stack<PlanConfigData>>(); 309Stack<PlanConfigData> pathToAdd = new Stack<PlanConfigData>(currentPath); 342List<Stack<PlanConfigData>> pathsByLength = _configIdToPaths[config.ConfigId]; 345pathsByLength.Sort(delegate (Stack<PlanConfigData> left, Stack<PlanConfigData> right) { return Comparer<int>.Default.Compare(left.Count, right.Count); }); 346foreach (Stack<PlanConfigData> path in pathsByLength)
Evaluation\Expander.cs (4)
1784internal static IEnumerable<KeyValuePair<string, S>> Transform<S>(Expander<P, I> expander, bool includeNullEntries, Stack<TransformFunction<S>> transformFunctionStack, IEnumerable<KeyValuePair<string, S>> itemsOfType) 2049Stack<TransformFunction<S>> transformFunctionStack = PrepareTransformStackFromMatch<S>(elementLocation, expressionCapture); 2132private static Stack<TransformFunction<S>> PrepareTransformStackFromMatch<S>(IElementLocation elementLocation, ExpressionShredder.ItemExpressionCapture match) 2138Stack<TransformFunction<S>> transformFunctionStack = new Stack<TransformFunction<S>>(match.Captures.Count);
Evaluation\LazyItemEvaluator.cs (2)
320Stack<LazyItemList> itemListStack = new Stack<LazyItemList>(); 325Stack<ImmutableHashSet<string>> globsToIgnoreStack = null;
Evaluation\Preprocessor.cs (1)
42private readonly Stack<string> _filePaths = new Stack<string>();
Evaluation\Profiler\EvaluationProfiler.cs (1)
22private readonly Stack<EvaluationFrame> _evaluationStack = new Stack<EvaluationFrame>();
Logging\SerialConsoleLogger.cs (1)
913private readonly Stack<Frame> _frames;
Microsoft.Build.Tasks.Core (1)
ParserState.cs (1)
22private readonly Stack<string> _namespaceStack = new Stack<string>();
Microsoft.Cci.Extensions (2)
HostEnvironment.cs (1)
687Stack<string> unexpandedPaths = new Stack<string>(paths);
Traversers\DependencyTraverser.cs (1)
17private readonly Stack<IDefinition> _definitionStack;
Microsoft.CodeAnalysis (31)
CodeGen\LocalScopeManager.cs (1)
25private readonly Stack<ScopeInfo> _scopes;
Collections\KeyedStack.cs (4)
18private readonly Dictionary<T, Stack<R>> _dict = new Dictionary<T, Stack<R>>(); 22Stack<R>? store; 34Stack<R>? store;
Collections\Rope.cs (3)
130var stack = new Stack<Rope>(); 159var stack = new Stack<Rope>(); 185var stack = new Stack<Rope>();
Collections\SmallDictionary.cs (3)
517private readonly Stack<AvlNode>? _stack; 632private readonly Stack<AvlNode>? _stack; 738private readonly Stack<AvlNode>? _stack;
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithSimpleName.cs (6)
31private static readonly ObjectPool<Stack<string>> s_stringStackPool = new ObjectPool<Stack<string>>(static () => new Stack<string>()); 32private static readonly ObjectPool<Stack<SyntaxNode>> s_nodeStackPool = new ObjectPool<Stack<SyntaxNode>>(static () => new Stack<SyntaxNode>()); 173var seenNames = s_stringStackPool.Allocate(); 240var nodeStack = s_nodeStackPool.Allocate();
Syntax\SyntaxDiffer.cs (7)
19private readonly Stack<SyntaxNodeOrToken> _oldNodes = new Stack<SyntaxNodeOrToken>(InitialStackSize); 20private readonly Stack<SyntaxNodeOrToken> _newNodes = new Stack<SyntaxNodeOrToken>(InitialStackSize); 320private static void ReplaceFirstWithChildren(Stack<SyntaxNodeOrToken> stack) 341private void FindBestMatch(Stack<SyntaxNodeOrToken> stack, in SyntaxNodeOrToken node, out int index, out int similarity, int startIndex = 0) 624private static TextSpan GetSpan(Stack<SyntaxNodeOrToken> stack, int first, int length) 694private static Queue<SyntaxNodeOrToken>? CopyFirst(Stack<SyntaxNodeOrToken> stack, int n) 718private static void RemoveFirst(Stack<SyntaxNodeOrToken> stack, int count)
Syntax\SyntaxNavigator.cs (6)
92private static readonly ObjectPool<Stack<ChildSyntaxList.Enumerator>> s_childEnumeratorStackPool 93= new ObjectPool<Stack<ChildSyntaxList.Enumerator>>(() => new Stack<ChildSyntaxList.Enumerator>(), 10); 97var stack = s_childEnumeratorStackPool.Allocate(); 138private static readonly ObjectPool<Stack<ChildSyntaxList.Reversed.Enumerator>> s_childReversedEnumeratorStackPool 139= new ObjectPool<Stack<ChildSyntaxList.Reversed.Enumerator>>(() => new Stack<ChildSyntaxList.Reversed.Enumerator>(), 10); 143var stack = s_childReversedEnumeratorStackPool.Allocate();
TreeDumper.cs (1)
260var stack = new Stack<KeyValuePair<TreeDumperNode?, TreeDumperNode>>();
Microsoft.CodeAnalysis.CodeStyle (44)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\IntervalTreeHelpers.cs (2)
37private static readonly ObjectPool<Stack<TNode>> s_nodeStackPool = new(() => new(), 128, trimOnFree: false); 84using var _ = s_nodeStackPool.GetPooledObject(out var candidates);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\IntervalTreeHelpers.NodeEnumerator.cs (2)
26private readonly PooledObject<Stack<TNode>> _pooledStack; 27private readonly Stack<TNode>? _stack;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (4)
32var stack = GetContainmentStack(symbol); 38var stack = GetContainmentStack(symbol); 42private static Stack<INamedTypeSymbol> GetContainmentStack(INamedTypeSymbol? symbol) 44var stack = new Stack<INamedTypeSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (5)
15public static bool TryPop<T>(this Stack<T> stack, [MaybeNullWhen(false)] out T result) 28public static void Push<T>(this Stack<T> stack, IEnumerable<T> values) 34public static void Push<T>(this Stack<T> stack, HashSet<T> values) 40public static void Push<T>(this Stack<T> stack, ImmutableArray<T> values) 46internal static void PushReverse<T, U>(this Stack<T> stack, IList<U> range)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (3)
852private static readonly ObjectPool<Stack<TDirectiveTriviaSyntax>> s_stackPool = new(() => new()); 864using var _1 = s_stackPool.GetPooledObject(out var regionStack); 865using var _2 = s_stackPool.GetPooledObject(out var ifStack);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeOrTokenExtensions.cs (2)
28using var pooledStack = SharedPools.Default<Stack<SyntaxNodeOrToken>>().GetPooledObject(); 29var stack = pooledStack.Object;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (2)
86using var pooledObject = SharedPools.Default<Stack<Node>>().GetPooledObject(); 88var spineNodes = pooledObject.Object;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (12)
28public static PooledObject<Stack<TItem>> GetPooledObject<TItem>(this ObjectPool<Stack<TItem>> pool) 29=> PooledObject<Stack<TItem>>.Create(pool); 46public static PooledObject<Stack<TItem>> GetPooledObject<TItem>(this ObjectPool<Stack<TItem>> pool, out Stack<TItem> stack) 48var pooledObject = PooledObject<Stack<TItem>>.Create(pool); 101public static Stack<T> AllocateAndClear<T>(this ObjectPool<Stack<T>> pool) 103var set = pool.Allocate(); 235public static void ClearAndFree<T>(this ObjectPool<Stack<T>> pool, Stack<T> stack)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (7)
49public static PooledObject<Stack<TItem>> Create<TItem>(ObjectPool<Stack<TItem>> pool) 51return new PooledObject<Stack<TItem>>( 115private static Stack<TItem> Allocator<TItem>(ObjectPool<Stack<TItem>> pool) 118private static void Releaser<TItem>(ObjectPool<Stack<TItem>> pool, Stack<TItem> obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (4)
20private static readonly ObjectPool<Stack<(SyntaxNodeOrToken nodeOrToken, bool leading, bool trailing)>> s_stackPool 21= SharedPools.Default<Stack<(SyntaxNodeOrToken nodeOrToken, bool leading, bool trailing)>>(); 39using var _ = s_stackPool.GetPooledObject(out var stack); 48ISyntaxFacts syntaxFacts, Stack<(SyntaxNodeOrToken nodeOrToken, bool leading, bool trailing)> stack)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
332private readonly Stack<ISymbol?> _contextualSymbolStack = new();
Microsoft.CodeAnalysis.CSharp (12)
Binder\Binder.QueryTranslationState.cs (1)
37public readonly Stack<QueryClauseSyntax> clauses = new Stack<QueryClauseSyntax>();
Compilation\SyntaxAndDeclarationManager.cs (3)
22private static readonly ObjectPool<Stack<SingleNamespaceOrTypeDeclaration>> s_declarationStack = 23new ObjectPool<Stack<SingleNamespaceOrTypeDeclaration>>(() => new Stack<SingleNamespaceOrTypeDeclaration>()); 615Stack<SingleNamespaceOrTypeDeclaration> stack = s_declarationStack.Allocate();
Compiler\DocumentationCommentCompiler.cs (1)
49private Stack<TemporaryStringBuilder> _temporaryStringBuilders;
Declarations\DeclarationTable.cs (2)
216var stack = new Stack<Declaration>(); 321var stack = new Stack<MergedNamespaceOrTypeDeclaration>();
Emitter\Model\PEModuleBuilder.cs (2)
340var namespacesAndTypesToProcess = new Stack<NamespaceOrTypeSymbol>(); 561var namespacesToProcess = new Stack<NamespaceSymbol>();
Symbols\TypeParameterSymbolExtensions.cs (1)
16Stack<TypeParameterSymbol>? stack = null;
Syntax\SyntaxEquivalence.cs (2)
16private static readonly ObjectPool<Stack<(GreenNode? before, GreenNode? after)>> s_equivalenceCheckStack = 17new ObjectPool<Stack<(GreenNode?, GreenNode?)>>(() => new Stack<(GreenNode?, GreenNode?)>());
Microsoft.CodeAnalysis.CSharp.CodeStyle (4)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
65using var pooledStack = SharedPools.Default<Stack<SyntaxNodeOrToken>>().GetPooledObject();
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
52nameof(Stack<int>),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (2)
338private static readonly ObjectPool<Stack<SyntaxNode>> s_nodeStackPool = SharedPools.Default<Stack<SyntaxNode>>();
Microsoft.CodeAnalysis.CSharp.Features (8)
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (2)
795var stack = queryExpressionProcessingInfo.Stack; 955public Stack<CSharpSyntaxNode> Stack { get; private set; }
DecompiledSource\CSharpDecompiledSourceService.cs (2)
109var containingTypeStack = new Stack<string>(); 110var containingNamespaceStack = new Stack<string>();
Highlighting\KeywordHighlighters\AsyncAwaitHighlighter.cs (2)
26private static readonly ObjectPool<Stack<SyntaxNode>> s_stackPool 27= SharedPools.Default<Stack<SyntaxNode>>();
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\CSharpRemoveRedundantNullableDirectiveDiagnosticAnalyzer.cs (1)
65using var pooledStack = SharedPools.Default<Stack<SyntaxNodeOrToken>>().GetPooledObject();
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (1)
52nameof(Stack<int>),
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
ObjectFormatterTests.cs (1)
571var obj = new Stack<int>();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (7)
Semantics\LookupPositionTests.cs (7)
3135private static string[][] MakeExpectedSymbols(params Action<Stack<string[]>>[] deltas) 3139Stack<string[]> stack = new Stack<string[]>(); 3152private static Action<Stack<string[]>> Combine(params Action<Stack<string[]>>[] deltas) 3161private static Action<Stack<string[]>> Add(params string[] added) 3172private static Action<Stack<string[]>> Remove(params string[] removed) 3183private static readonly Action<Stack<string[]>> s_pop = stack => stack.Pop();
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\AnonymousTypesSemanticsTests.cs (1)
2053var stack = new Stack<SyntaxNode>();
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Parsing\ParsingTests.cs (1)
262var stack = new Stack<ChildSyntaxList.Enumerator>(24);
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (2)
338private static readonly ObjectPool<Stack<SyntaxNode>> s_nodeStackPool = SharedPools.Default<Stack<SyntaxNode>>();
Microsoft.CodeAnalysis.EditorFeatures (2)
InlineRename\AbstractInlineRenameUndoManager.cs (2)
34protected readonly Stack<ActiveSpanState> UndoStack = new Stack<ActiveSpanState>(); 35protected readonly Stack<ActiveSpanState> RedoStack = new Stack<ActiveSpanState>();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
Extensions\CollectionExtensionsTest.cs (3)
19var stack = new Stack<int>(); 30var stack = new Stack<int>(); 38var stack = new Stack<int>();
Microsoft.CodeAnalysis.Features (9)
BracePairs\IBracePairsService.cs (1)
51using var pooledStack = SharedPools.Default<Stack<SyntaxNodeOrToken>>().GetPooledObject();
DocumentationComments\AbstractDocumentationCommentFormattingService.cs (2)
67private readonly Stack<(string target, string hint)> _navigationTargetStack = new(); 74private readonly Stack<TaggedTextStyle> _styleStack = new();
EmbeddedLanguages\Classification\AbstractEmbeddedLanguageClassificationService.cs (1)
86using var pooledStack = SharedPools.Default<Stack<SyntaxNodeOrToken>>().GetPooledObject();
ExtractMethod\MethodExtractor.TriviaResult.cs (1)
136var stack = new Stack<SyntaxTrivia>();
Shared\Utilities\ExtractTypeHelpers.cs (1)
167var typesToVisit = new Stack<INamedTypeSymbol>();
ValueTracking\ValueTrackingProgressCollector.cs (1)
16private readonly Stack<ValueTrackedItem> _items = new();
Wrapping\BinaryExpression\AbstractBinaryExpressionWrapper.cs (1)
107using var pooledStack = SharedPools.Default<Stack<SyntaxNodeOrToken>>().GetPooledObject();
Wrapping\ChainedExpression\AbstractChainedExpressionWrapper.cs (1)
275using var pooledStack = SharedPools.Default<Stack<SyntaxNodeOrToken>>().GetPooledObject();
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Handler\Configuration\DidChangeConfigurationNotificationHandler.cs (1)
198using var pooledStack = SharedPools.Default<Stack<string>>().GetPooledObject();
Microsoft.CodeAnalysis.Test.Utilities (4)
Assert\AssertXml.cs (1)
154Stack<Tuple<XElement, XElement>> stack = new Stack<Tuple<XElement, XElement>>();
MarkedSource\MarkupTestFile.cs (3)
65var spanStartStack = new Stack<(int matchIndex, string name)>(); 66var namedSpanStartStack = new Stack<(int matchIndex, string name)>(); 192Stack<(int matchIndex, string name)> spanStartStack,
Microsoft.CodeAnalysis.VisualBasic (2)
Compilation\DocumentationComments\DocWriter.vb (1)
25Private _temporaryStringBuilders As Stack(Of TemporaryStringBuilder)
Lowering\Diagnostics\DiagnosticsPass.vb (1)
26Private _expressionsBeingVisited As Stack(Of BoundExpression)
Microsoft.CodeAnalysis.Workspaces (60)
Classification\SyntaxClassification\AbstractSyntaxClassificationService.Worker.cs (2)
28private readonly Stack<SyntaxNodeOrToken> _pendingNodes; 32private static readonly ObjectPool<Stack<SyntaxNodeOrToken>> s_stackPool = new(() => new(), trimOnFree: false);
Classification\SyntaxClassification\SyntacticChangeRangeComputer.cs (8)
38private static readonly ObjectPool<Stack<ChildSyntaxList.Enumerator>> s_enumeratorPool = new(() => new()); 39private static readonly ObjectPool<Stack<ChildSyntaxList.Reversed.Enumerator>> s_reversedEnumeratorPool = new(() => new()); 122using var _1 = s_enumeratorPool.GetPooledObject(out var oldStack); 123using var _2 = s_enumeratorPool.GetPooledObject(out var newStack); 176var oldStack = rightOldStack.Object; 177var newStack = rightNewStack.Object; 242private static bool TryGetStackTopNodeOrToken(Stack<ChildSyntaxList.Enumerator> stack, out SyntaxNodeOrToken syntaxNodeOrToken) 259private static bool TryGetStackTopNodeOrToken(Stack<ChildSyntaxList.Reversed.Enumerator> stack, out SyntaxNodeOrToken syntaxNodeOrToken)
ExternalAccess\Pythia\Api\PythiaObjectPool.cs (2)
23public static IDisposable GetInstance<T>(out Stack<T> instance) 25var disposer = Default<Stack<T>>().GetPooledObject();
FindSymbols\FindReferences\FindReferenceCache.cs (2)
156using var obj = SharedPools.Default<Stack<SyntaxNodeOrToken>>().GetPooledObject(); 158var stack = obj.Object;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\IntervalTreeHelpers.cs (2)
37private static readonly ObjectPool<Stack<TNode>> s_nodeStackPool = new(() => new(), 128, trimOnFree: false); 84using var _ = s_nodeStackPool.GetPooledObject(out var candidates);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\IntervalTreeHelpers.NodeEnumerator.cs (2)
26private readonly PooledObject<Stack<TNode>> _pooledStack; 27private readonly Stack<TNode>? _stack;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (4)
32var stack = GetContainmentStack(symbol); 38var stack = GetContainmentStack(symbol); 42private static Stack<INamedTypeSymbol> GetContainmentStack(INamedTypeSymbol? symbol) 44var stack = new Stack<INamedTypeSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StackExtensions.cs (5)
15public static bool TryPop<T>(this Stack<T> stack, [MaybeNullWhen(false)] out T result) 28public static void Push<T>(this Stack<T> stack, IEnumerable<T> values) 34public static void Push<T>(this Stack<T> stack, HashSet<T> values) 40public static void Push<T>(this Stack<T> stack, ImmutableArray<T> values) 46internal static void PushReverse<T, U>(this Stack<T> stack, IList<U> range)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (3)
852private static readonly ObjectPool<Stack<TDirectiveTriviaSyntax>> s_stackPool = new(() => new()); 864using var _1 = s_stackPool.GetPooledObject(out var regionStack); 865using var _2 = s_stackPool.GetPooledObject(out var ifStack);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeOrTokenExtensions.cs (2)
28using var pooledStack = SharedPools.Default<Stack<SyntaxNodeOrToken>>().GetPooledObject(); 29var stack = pooledStack.Object;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\ContextMutableIntervalTree.cs (2)
86using var pooledObject = SharedPools.Default<Stack<Node>>().GetPooledObject(); 88var spineNodes = pooledObject.Object;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (12)
28public static PooledObject<Stack<TItem>> GetPooledObject<TItem>(this ObjectPool<Stack<TItem>> pool) 29=> PooledObject<Stack<TItem>>.Create(pool); 46public static PooledObject<Stack<TItem>> GetPooledObject<TItem>(this ObjectPool<Stack<TItem>> pool, out Stack<TItem> stack) 48var pooledObject = PooledObject<Stack<TItem>>.Create(pool); 101public static Stack<T> AllocateAndClear<T>(this ObjectPool<Stack<T>> pool) 103var set = pool.Allocate(); 235public static void ClearAndFree<T>(this ObjectPool<Stack<T>> pool, Stack<T> stack)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (7)
49public static PooledObject<Stack<TItem>> Create<TItem>(ObjectPool<Stack<TItem>> pool) 51return new PooledObject<Stack<TItem>>( 115private static Stack<TItem> Allocator<TItem>(ObjectPool<Stack<TItem>> pool) 118private static void Releaser<TItem>(ObjectPool<Stack<TItem>> pool, Stack<TItem> obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (4)
20private static readonly ObjectPool<Stack<(SyntaxNodeOrToken nodeOrToken, bool leading, bool trailing)>> s_stackPool 21= SharedPools.Default<Stack<(SyntaxNodeOrToken nodeOrToken, bool leading, bool trailing)>>(); 39using var _ = s_stackPool.GetPooledObject(out var stack); 48ISyntaxFacts syntaxFacts, Stack<(SyntaxNodeOrToken nodeOrToken, bool leading, bool trailing)> stack)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
332private readonly Stack<ISymbol?> _contextualSymbolStack = new();
Storage\SQLite\v2\SQLitePersistentStorage.cs (1)
39private readonly Stack<SqlConnection> _connectionsPool = new();
Storage\SQLite\v2\SQLitePersistentStorage_Helpers.cs (1)
89private static readonly Stack<byte[]> s_byteArrayPool = new();
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (19)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (12)
28public static PooledObject<Stack<TItem>> GetPooledObject<TItem>(this ObjectPool<Stack<TItem>> pool) 29=> PooledObject<Stack<TItem>>.Create(pool); 46public static PooledObject<Stack<TItem>> GetPooledObject<TItem>(this ObjectPool<Stack<TItem>> pool, out Stack<TItem> stack) 48var pooledObject = PooledObject<Stack<TItem>>.Create(pool); 101public static Stack<T> AllocateAndClear<T>(this ObjectPool<Stack<T>> pool) 103var set = pool.Allocate(); 235public static void ClearAndFree<T>(this ObjectPool<Stack<T>> pool, Stack<T> stack)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (7)
49public static PooledObject<Stack<TItem>> Create<TItem>(ObjectPool<Stack<TItem>> pool) 51return new PooledObject<Stack<TItem>>( 115private static Stack<TItem> Allocator<TItem>(ObjectPool<Stack<TItem>> pool) 118private static void Releaser<TItem>(ObjectPool<Stack<TItem>> pool, Stack<TItem> obj)
Microsoft.DotNet.AsmDiff (4)
ApiRecordingCSharpDiffWriter.cs (2)
18private Stack<List<DiffApiDefinition>> _apiStack = new Stack<List<DiffApiDefinition>>(); 19private Stack<DiffApiDefinition> _apiDefinitionStack = new Stack<DiffApiDefinition>();
DiffEngine.cs (1)
204var startLineStack = new Stack<DiffLine>();
DiffRecorder.cs (1)
14private Stack<DiffStyle> _styleStack = new Stack<DiffStyle>();
Microsoft.DotNet.PackageTesting (4)
VerifyClosure.cs (4)
167var depStack = new Stack<AssemblyInfo>(); 174void CheckDependencies(Stack<AssemblyInfo> depStack) 258var depStack = new Stack<AssemblyInfo>(); 275void DumpCycles(Stack<AssemblyInfo> depStack, AssemblyInfo root, Dictionary<AssemblyInfo, AssemblyInfo[]> suspectCycles)
Microsoft.DotNet.SharedFramework.Sdk (4)
src\Microsoft.DotNet.PackageTesting\VerifyClosure.cs (4)
167var depStack = new Stack<AssemblyInfo>(); 174void CheckDependencies(Stack<AssemblyInfo> depStack) 258var depStack = new Stack<AssemblyInfo>(); 275void DumpCycles(Stack<AssemblyInfo> depStack, AssemblyInfo root, Dictionary<AssemblyInfo, AssemblyInfo[]> suspectCycles)
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (8)
Modeler\ServiceClientModelFactory.cs (8)
40private readonly AsyncLocal<Stack<string>> _propertyNameStack = new AsyncLocal<Stack<string>>(); 41private readonly AsyncLocal<Stack<string>> _typeNameStack = new AsyncLocal<Stack<string>>(); 42private readonly AsyncLocal<Stack<string>> _parameterNameStack = new AsyncLocal<Stack<string>>(); 43private readonly AsyncLocal<Stack<string>> _methodNameStack = new AsyncLocal<Stack<string>>();
Microsoft.DotNet.VersionTools (1)
BuildManifest\VersionIdentifier.cs (1)
96Stack<(int versionNumber, int index)> majorMinorPatchStack = new Stack<(int,int)>(3);
Microsoft.Extensions.AI.Abstractions.Tests (2)
test\Shared\JsonSchemaExporter\TestTypes.cs (2)
798yield return new TestData<Stack<char>>(new(['x', '2', '+']), """{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":1}}"""); 1280[JsonSerializable(typeof(Stack<char>))]
Microsoft.Extensions.Configuration (1)
ConfigurationSectionDebugView.cs (1)
47var stack = new Stack<IConfiguration>();
Microsoft.Extensions.Configuration.Abstractions (1)
ConfigurationExtensions.cs (1)
56var stack = new Stack<IConfiguration>();
Microsoft.Extensions.Configuration.Json (1)
JsonConfigurationFileParser.cs (1)
17private readonly Stack<string> _paths = new Stack<string>();
Microsoft.Extensions.Configuration.Xml (2)
XmlStreamConfigurationProvider.cs (2)
54var currentPath = new Stack<XmlConfigurationElement>(); 420private readonly Stack<int> _lengths;
Microsoft.Extensions.FileSystemGlobbing (1)
Internal\PatternContexts\PatternContext.cs (1)
12private readonly Stack<TFrame> _stack = new();
Microsoft.Extensions.Identity.Core (1)
TokenProviderDescriptor.cs (1)
16private readonly Stack<Type> _providerTypes = new(1);
Microsoft.Extensions.SecretManager.Tools.Tests (1)
UserSecretsTestFixture.cs (1)
13private Stack<Action> _disposables = new Stack<Action>();
Microsoft.Gen.ComplianceReports (1)
Emitter.cs (1)
15private readonly Stack<int> _itemCounts = new();
Microsoft.Gen.Logging (2)
Emission\StringBuilderPool.cs (1)
11private readonly Stack<StringBuilder> _builders = new();
src\Generators\Shared\StringBuilderPool.cs (1)
16private readonly Stack<StringBuilder> _builders = new();
Microsoft.Gen.Metrics (1)
src\Generators\Shared\StringBuilderPool.cs (1)
16private readonly Stack<StringBuilder> _builders = new();
Microsoft.Gen.MetricsReports (1)
src\Generators\Shared\StringBuilderPool.cs (1)
16private readonly Stack<StringBuilder> _builders = new();
Microsoft.Interop.SourceGeneration (3)
ManualTypeMarshallingHelper.cs (1)
362Stack<ITypeSymbol> typeStack = new();
TypeSymbolExtensions.cs (2)
229Stack<INamedTypeSymbol> originalNestedTypes = new(); 309Stack<(ImmutableArray<ITypeSymbol>, ImmutableArray<NullableAnnotation>)> genericTypesToSubstitute = new();
Microsoft.Maui.Controls (2)
Compatibility\Handlers\TableView\iOS\TableViewRenderer.cs (1)
40 var viewsToLookAt = new Stack<UIView>(Subviews);
Profiler.cs (1)
34 static Stack<Profile> Stack;
Microsoft.Maui.Graphics (4)
AbstractCanvas.cs (1)
14 private readonly Stack<TState> _stateStack = new Stack<TState>();
PathBuilder.cs (1)
20 private readonly Stack<string> _commandStack = new Stack<string>();
ScalingCanvas.cs (2)
13 private readonly Stack<float> _scaleXStack = new Stack<float>(); 14 private readonly Stack<float> _scaleYStack = new Stack<float>();
Microsoft.Maui.Graphics.Text.Markdig (1)
Renderer\HtmlInlineRenderer.cs (1)
10 private Stack<SpanData> _spans = new Stack<SpanData>();
Microsoft.ML.Core (2)
Utilities\Utils.cs (2)
90public static int Size<T>(Stack<T> x) 173public static void Push<T>(ref Stack<T> stack, T item)
Microsoft.ML.Data (2)
Prediction\Calibrator.cs (1)
1882Stack<Piece> stack = new Stack<Piece>();
Utilities\StreamUtils.cs (1)
93var dirsLeft = new Stack<string>();
Microsoft.ML.TorchSharp (1)
AutoFormerV2\ObjectDetectionMetrics.cs (1)
260Stack<Tuple<float, float>> prStack = new(); // precision and recall * groundTruthBoxesNum (= true positive)
Microsoft.VisualStudio.LanguageServices (1)
ProjectSystem\Legacy\AbstractLegacyProject_IProjectSiteEx.cs (1)
18private readonly Stack<ProjectSystemProject.BatchScope> _batchScopes = new();
mscorlib (1)
mscorlib.cs (1)
58[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.Stack<>))]
netstandard (1)
netstandard.cs (1)
133[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.Stack<>))]
PresentationBuildTasks (2)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\MarkupExtensionParser.cs (1)
928Stack<char> bracketCharacterStack = new Stack<char>();
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\StyleModeStack.cs (1)
68private Stack<StyleMode> _stack = new Stack<StyleMode>(64);
PresentationCore (13)
MS\Internal\TextFormatting\TextStore.cs (1)
2688Stack<TextModifier> directionalEmbeddingStack = new Stack<TextModifier>(32);
MS\Internal\UIElementHelper.cs (1)
142Stack<DependencyObject> branchNodeStack = new Stack<DependencyObject>();
System\Windows\EventRoute.cs (1)
532private Stack<BranchNode> _branchNodeStack;
System\Windows\Generated\ContentElement.cs (1)
725internal virtual bool InvalidateAutomationAncestorsCore(Stack<DependencyObject> branchNodeStack, out bool continuePastVisualTree)
System\Windows\Generated\UIElement.cs (1)
725internal virtual bool InvalidateAutomationAncestorsCore(Stack<DependencyObject> branchNodeStack, out bool continuePastVisualTree)
System\Windows\Generated\UIElement3D.cs (1)
520internal virtual bool InvalidateAutomationAncestorsCore(Stack<DependencyObject> branchNodeStack, out bool continuePastVisualTree)
System\Windows\Media\BoundsDrawingContextWalker.cs (3)
650private Stack<PushType> _pushTypeStack; 654private Stack<Matrix> _transformStack; 658private Stack<Rect> _clipStack;
System\Windows\Media\DrawingDrawingContext.cs (1)
1434private Stack<DrawingGroup> _previousDrawingGroupStack;
System\Windows\Media\Generated\RenderData.cs (1)
545Stack<PushType> pushStack = new Stack<PushType>();
System\Windows\Media\HitTestWithPointDrawingContextWalker.cs (1)
442private Stack<Point> _pointStack;
System\Windows\Media3D\Viewport2DVisual3D.cs (1)
462Stack<Material> materialStack = new Stack<Material>();
PresentationFramework (37)
MS\Internal\Annotations\Anchoring\LocatorManager.cs (1)
1311private Stack<bool> _calledProcessAnnotations = new Stack<bool>();
MS\Internal\Data\LiveShapingBlock.cs (2)
310Stack<LiveShapingBlock> stack = new Stack<LiveShapingBlock>(list); 391Stack<LiveShapingBlock> stack = new Stack<LiveShapingBlock>(list);
MS\Internal\Globalization\BamlResourceDeserializer.cs (6)
353Stack<ILocalizabilityInheritable> stackForProperty; 371Stack<ILocalizabilityInheritable> stackForProperty = _propertyInheritanceTreeStack[propertyName]; 380Stack<ILocalizabilityInheritable> stackForProperty = _propertyInheritanceTreeStack[propertyName]; 396private Stack<BamlTreeNode> _bamlTreeStack = new Stack<BamlTreeNode>(); 399private Dictionary<string, Stack<ILocalizabilityInheritable>> _propertyInheritanceTreeStack 400= new Dictionary<string, Stack<ILocalizabilityInheritable>>(8);
MS\Internal\Globalization\BamlResourceSerializer.cs (1)
106private Stack<BamlTreeNode> _bamlTreeStack;
MS\Internal\Ink\EditingCoordinator.cs (1)
1386private Stack<EditingBehavior> _activationStack;
MS\Internal\PtsHost\StructuralCache.cs (2)
782private Stack<DocumentFormatInfo> _documentFormatInfoStack = new Stack<DocumentFormatInfo>(); 859private Stack<DocumentArrangeInfo> _documentArrangeInfoStack = new Stack<DocumentArrangeInfo>();
System\Windows\Application.cs (1)
2499private static Stack<NestedBamlLoadInfo> s_NestedBamlLoadInfo = null;
System\Windows\Controls\FlowDocumentReader.cs (1)
883internal override bool InvalidateAutomationAncestorsCore(Stack<DependencyObject> branchNodeStack, out bool continuePastCoreTree)
System\Windows\Controls\FlowDocumentScrollViewer.cs (1)
817internal override bool InvalidateAutomationAncestorsCore(Stack<DependencyObject> branchNodeStack, out bool continuePastCoreTree)
System\Windows\Controls\InkCanvas.cs (1)
278Stack<Transform> transforms = new Stack<Transform>();
System\Windows\Controls\SinglePageViewer.cs (1)
795internal override bool InvalidateAutomationAncestorsCore(Stack<DependencyObject> branchNodeStack, out bool continuePastCoreTree)
System\Windows\Diagnostics\ResourceDictionaryDiagnostics.cs (1)
533private static Stack<LookupResult> _lookupResultStack;
System\Windows\Documents\TextRangeBase.cs (4)
668Stack<int> listItemCounter = null; 794private static void PlainConvertListStart(ITextPointer navigator, ref Stack<int> listItemCounter) 808private static void PlainConvertListEnd(ITextPointer navigator, ref Stack<int> listItemCounter) 822private static void PlainConvertListItemStart(StringBuilder textBuffer, ITextPointer navigator, ref Stack<int> listItemCounter)
System\Windows\Documents\TextStore.cs (1)
4882private Stack<IMECompositionTraceOp> _opStack = new Stack<IMECompositionTraceOp>();
System\Windows\Documents\XPSS0ValidatingLoader.cs (1)
218static private Stack<Hashtable> _validResources = new Stack<Hashtable>();
System\Windows\FrameworkContentElement.cs (1)
1392internal override bool InvalidateAutomationAncestorsCore(Stack<DependencyObject> branchNodeStack, out bool continuePastCoreTree)
System\Windows\FrameworkElement.cs (2)
3060internal override bool InvalidateAutomationAncestorsCore(Stack<DependencyObject> branchNodeStack, out bool continuePastCoreTree) 3101internal bool InvalidateAutomationAncestorsCoreHelper(Stack<DependencyObject> branchNodeStack, out bool continuePastCoreTree, bool shouldInvalidateIntermediateElements)
System\Windows\Markup\Baml2006\Baml2006Reader.cs (1)
32private Stack<XamlWriter> _xamlWriterStack = new Stack<XamlWriter>();
System\Windows\Markup\BamlReader.cs (4)
1440Stack<bool> readProperty = new(); 1441Stack<bool> readConstructor = new(); 1442Stack<bool> readFirstConstructor = new(); 2835private readonly Stack<BamlNodeInfo> _nodeStack;
System\Windows\Markup\MarkupExtensionParser.cs (1)
928Stack<char> bracketCharacterStack = new Stack<char>();
System\Windows\Markup\StyleModeStack.cs (1)
68private Stack<StyleMode> _stack = new Stack<StyleMode>(64);
System\Windows\TreeChangeInfo.cs (2)
198internal Stack<FrugalObjectList<DependencyProperty>> InheritablePropertiesStack 241private Stack<FrugalObjectList<DependencyProperty>> _inheritablePropertiesStack;
ReachFramework (6)
Serialization\Manager\ReachVisualSerializer.cs (1)
97Stack<NodeContext> contextStack = new Stack<NodeContext>();
Serialization\Manager\ReachVisualSerializerAsync.cs (5)
125Stack<NodeContext> contextStack = new Stack<NodeContext>(); 145Stack<NodeContext> contextStack = context.ContextStack; 260Stack<NodeContext> contextStack, 272Stack<NodeContext> 293Stack<NodeContext> _contextStack;
RunTests (1)
TestRunner.cs (1)
329var waiting = new Stack<WorkItemInfo>(workItems);
Shared.Tests (2)
JsonSchemaExporter\TestTypes.cs (2)
798yield return new TestData<Stack<char>>(new(['x', '2', '+']), """{"type":["array","null"],"items":{"type":"string","minLength":1,"maxLength":1}}"""); 1280[JsonSerializable(typeof(Stack<char>))]
Stress.ApiService (1)
TraceCreator.cs (1)
37var activityStack = new Stack<Activity>();
System (1)
src\libraries\shims\System\ref\System.cs (1)
141[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Collections.Generic.Stack<>))]
System.CodeDom (1)
src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (1)
175var subTypeNames = new Stack<string>();
System.Collections (9)
System\Collections\Generic\SortedSet.cs (3)
194var stack = new Stack<Node>(2 * (int)Log2(Count + 1)); 1635var pendingNodes = new Stack<(Node source, Node target)>(2 * Log2(count) + 2); 1837private readonly Stack<Node> _stack;
System\Collections\Generic\SortedSet.TreeSubSet.cs (1)
196Stack<Node> stack = new Stack<Node>(2 * (int)SortedSet<T>.Log2(count + 1)); // this is not exactly right if count is out of date, but the stack can grow
System\Collections\Generic\Stack.cs (3)
175/// Sets the capacity of a <see cref="Stack{T}"/> object to a specified number of entries. 354private readonly Stack<T> _stack; 359internal Enumerator(Stack<T> stack)
System\Collections\Generic\StackDebugView.cs (2)
10private readonly Stack<T> _stack; 12public StackDebugView(Stack<T> stack)
System.Collections.Immutable (41)
System\Collections\Immutable\AllocFreeConcurrentStack.cs (3)
15private static Stack<RefAsValueType<T>>? t_stack; 22Stack<RefAsValueType<T>> localStack = 40Stack<RefAsValueType<T>>? localStack = t_stack; // cache in a local to avoid unnecessary TLS hits on repeated accesses
System\Collections\Immutable\ImmutableExtensions.cs (4)
64/// Clears the specified stack. For empty stacks, it avoids the call to <see cref="Stack{T}.Clear"/>, which 66/// in particular around inlining. <see cref="Stack{T}.Count"/> typically gets inlined by today's JIT, while 67/// <see cref="Stack{T}.Clear"/> and <see cref="Array.Clear(Array, int, int)"/> typically don't. 71internal static void ClearFastWhenEmpty<T>(this Stack<T> stack)
System\Collections\Immutable\ImmutableList_1.Enumerator.cs (8)
67private SecurePooledObject<Stack<RefAsValueType<Node>>>? _stack; 107if (!SecureObjectPool<Stack<RefAsValueType<Node>>, Enumerator>.TryTake(this, out _stack)) 109_stack = SecureObjectPool<Stack<RefAsValueType<Node>>, Enumerator>.PrepNew(this, new Stack<RefAsValueType<Node>>(root.Height)); 148if (_stack != null && _stack.TryUse(ref this, out Stack<RefAsValueType<Node>>? stack)) 151SecureObjectPool<Stack<RefAsValueType<Node>>, Enumerator>.TryAdd(this, _stack!); 168Stack<RefAsValueType<ImmutableList<T>.Node>> stack = _stack.Use(ref this); 202Stack<RefAsValueType<ImmutableList<T>.Node>> stack = _stack.Use(ref this); 276Stack<RefAsValueType<ImmutableList<T>.Node>> stack = _stack.Use(ref this);
System\Collections\Immutable\ImmutableSortedDictionary_2.Enumerator.cs (8)
47private SecurePooledObject<Stack<RefAsValueType<Node>>>? _stack; 76if (!SecureObjectPool<Stack<RefAsValueType<Node>>, Enumerator>.TryTake(this, out _stack)) 78_stack = SecureObjectPool<Stack<RefAsValueType<Node>>, Enumerator>.PrepNew(this, new Stack<RefAsValueType<Node>>(root.Height)); 123if (_stack != null && _stack.TryUse(ref this, out Stack<RefAsValueType<Node>>? stack)) 126SecureObjectPool<Stack<RefAsValueType<Node>>, Enumerator>.TryAdd(this, _stack!); 143Stack<RefAsValueType<ImmutableSortedDictionary<TKey, TValue>.Node>> stack = _stack.Use(ref this); 168Stack<RefAsValueType<ImmutableSortedDictionary<TKey, TValue>.Node>> stack = _stack.Use(ref this); 211Stack<RefAsValueType<ImmutableSortedDictionary<TKey, TValue>.Node>> stack = _stack.Use(ref this);
System\Collections\Immutable\ImmutableSortedSet_1.Enumerator.cs (9)
53/// the underlying array that the <see cref="Stack{T}"/> class uses is written to. 59private SecurePooledObject<Stack<RefAsValueType<Node>>>? _stack; 88if (!SecureObjectPool<Stack<RefAsValueType<Node>>, Enumerator>.TryTake(this, out _stack)) 90_stack = SecureObjectPool<Stack<RefAsValueType<Node>>, Enumerator>.PrepNew(this, new Stack<RefAsValueType<Node>>(root.Height)); 134if (_stack != null && _stack.TryUse(ref this, out Stack<RefAsValueType<Node>>? stack)) 137SecureObjectPool<Stack<RefAsValueType<Node>>, Enumerator>.TryAdd(this, _stack!); 151Stack<RefAsValueType<ImmutableSortedSet<T>.Node>> stack = _stack!.Use(ref this); 175Stack<RefAsValueType<ImmutableSortedSet<T>.Node>> stack = _stack!.Use(ref this); 216Stack<RefAsValueType<ImmutableSortedSet<T>.Node>> stack = _stack!.Use(ref this);
System\Collections\Immutable\RefAsValueType.cs (1)
15/// the underlying array that the <see cref="Stack{T}"/> class uses is written to.
System\Collections\Immutable\SortedInt32KeyNode.Enumerator.cs (8)
41private SecurePooledObject<Stack<RefAsValueType<SortedInt32KeyNode<TValue>>>>? _stack; 62if (!SecureObjectPool<Stack<RefAsValueType<SortedInt32KeyNode<TValue>>>, Enumerator>.TryTake(this, out _stack)) 64_stack = SecureObjectPool<Stack<RefAsValueType<SortedInt32KeyNode<TValue>>>, Enumerator>.PrepNew(this, new Stack<RefAsValueType<SortedInt32KeyNode<TValue>>>(root.Height)); 109if (_stack != null && _stack.TryUse(ref this, out Stack<RefAsValueType<SortedInt32KeyNode<TValue>>>? stack)) 112SecureObjectPool<Stack<RefAsValueType<SortedInt32KeyNode<TValue>>>, Enumerator>.TryAdd(this, _stack!); 128Stack<RefAsValueType<SortedInt32KeyNode<TValue>>> stack = _stack.Use(ref this); 152Stack<RefAsValueType<SortedInt32KeyNode<TValue>>> stack = _stack.Use(ref this); 182Stack<RefAsValueType<SortedInt32KeyNode<TValue>>> stack = _stack!.Use(ref this);
System.ComponentModel.Composition (12)
Microsoft\Internal\Collections\CollectionServices.cs (2)
196public static Stack<T> Copy<T>(this Stack<T> stack)
System\ComponentModel\Composition\CompositionException.cs (9)
162List<Stack<CompositionError>> paths = CalculatePaths(this); 208private static void WritePaths(StringBuilder writer, List<Stack<CompositionError>> paths) 211foreach (Stack<CompositionError> path in paths) 218private static void WritePath(StringBuilder writer, Stack<CompositionError> path, int ordinal) 263private static List<Stack<CompositionError>> CalculatePaths(CompositionException exception) 265List<Stack<CompositionError>> paths = new List<Stack<CompositionError>>(); 325public Stack<CompositionError> Path; 326public Action<Stack<CompositionError>> LeafVisitor;
System\ComponentModel\Composition\Hosting\ImportEngine.cs (1)
24private readonly Stack<PartManager> _recursionStateStack = new Stack<PartManager>();
System.Composition.Hosting (4)
System\Composition\Hosting\Core\ExportDescriptorRegistryUpdate.cs (4)
40var checking = new Stack<CompositionDependency>(); 54private void CheckTarget(CompositionDependency dependency, HashSet<ExportDescriptorPromise> @checked, Stack<CompositionDependency> checking) 79private void CheckDependency(CompositionDependency dependency, HashSet<ExportDescriptorPromise> @checked, Stack<CompositionDependency> checking) 114private static StringBuilder DescribeCompositionStack(CompositionDependency import, Stack<CompositionDependency> dependencies)
System.Console (5)
System\IO\StdInReader.cs (2)
23private readonly Stack<ConsoleKeyInfo> _tmpKeys = new Stack<ConsoleKeyInfo>(); // temporary working stack; should be empty outside of ReadLine 24private readonly Stack<ConsoleKeyInfo> _availableKeys = new Stack<ConsoleKeyInfo>(); // a queue of already processed key infos available for reading
System\TermInfo.cs (3)
18private static Stack<FormatParam>? t_cachedStack; 66Stack<FormatParam>? stack = t_cachedStack; 101string format, ref int pos, FormatParam[] args, Stack<FormatParam> stack,
System.Data.Common (1)
System\Data\XmlDataLoader.cs (1)
21private readonly Stack<DataRow>? _childRowsStack;
System.Formats.Asn1 (3)
System\Formats\Asn1\AsnDecoder.BitString.cs (1)
466Stack<(int Offset, int Length, bool Indefinite, int BytesRead)>? readerStack = null;
System\Formats\Asn1\AsnDecoder.OctetString.cs (1)
336Stack<(int Offset, int Length, bool IsIndefinite, int BytesRead)>? readerStack = null;
System\Formats\Asn1\AsnWriter.cs (1)
22private Stack<StackFrame>? _nestingStack;
System.Formats.Cbor (5)
System\Formats\Cbor\Reader\CborReader.cs (1)
15private Stack<StackFrame>? _nestedDataItems;
System\Formats\Cbor\Reader\CborReader.Map.cs (1)
12private Stack<HashSet<(int Offset, int Length)>>? _pooledKeyEncodingRangeAllocations;
System\Formats\Cbor\Writer\CborWriter.cs (1)
21private Stack<StackFrame>? _nestedDataItems;
System\Formats\Cbor\Writer\CborWriter.Map.cs (2)
14private Stack<HashSet<(int Offset, int Length)>>? _pooledKeyEncodingRangeSets; 15private Stack<List<KeyValuePairEncodingRange>>? _pooledKeyValuePairEncodingRangeLists;
System.Formats.Nrbf (4)
System\Formats\Nrbf\NextInfo.cs (2)
13Stack<NextInfo> stack, PrimitiveType primitiveType = default) 25internal Stack<NextInfo> Stack { get; }
System\Formats\Nrbf\NrbfDecoder.cs (2)
162Stack<NextInfo> readStack = new(); 476private static void PushFirstNestedRecordInfo(SerializationRecord record, Stack<NextInfo> readStack)
System.Formats.Tar (6)
System\Formats\Tar\TarEntry.cs (2)
303internal void ExtractRelativeToDirectory(string destinationDirectoryPath, bool overwrite, SortedDictionary<string, UnixFileMode>? pendingModes, Stack<(string, DateTimeOffset)> directoryModificationTimes) 321internal Task ExtractRelativeToDirectoryAsync(string destinationDirectoryPath, bool overwrite, SortedDictionary<string, UnixFileMode>? pendingModes, Stack<(string, DateTimeOffset)> directoryModificationTimes, CancellationToken cancellationToken)
System\Formats\Tar\TarFile.cs (2)
461var directoryModificationTimes = new Stack<(string, DateTimeOffset)>(); 503var directoryModificationTimes = new Stack<(string, DateTimeOffset)>();
System\Formats\Tar\TarHelpers.cs (2)
412public static void SetPendingModificationTimes(Stack<(string, DateTimeOffset)> directoryModificationTimes) 421public static void UpdatePendingModificationTimes(Stack<(string, DateTimeOffset)> directoryModificationTimes, string fullPath, DateTimeOffset modified)
System.Linq.Expressions (13)
System\Dynamic\BindingRestrictions.cs (3)
146private readonly Stack<AndNode> _tests = new Stack<AndNode>(); 212var stack = new Stack<BindingRestrictions>(); 365var stack = new Stack<BindingRestrictions>();
System\Linq\Expressions\Compiler\KeyedStack.cs (4)
14private readonly Dictionary<TKey, Stack<TValue>> _data = new Dictionary<TKey, Stack<TValue>>(); 18if (!_data.TryGetValue(key, out Stack<TValue>? stack)) 27_data.TryGetValue(key, out Stack<TValue>? stack) && stack.TryPop(out TValue? value) ? value : null;
System\Linq\Expressions\Compiler\StackSpiller.Temps.cs (1)
93private Stack<ParameterExpression>? _usedTemps;
System\Linq\Expressions\Compiler\VariableBinder.cs (2)
20private readonly Stack<CompilerScope> _scopes = new Stack<CompilerScope>(); 21private readonly Stack<BoundConstants> _constants = new Stack<BoundConstants>();
System\Linq\Expressions\Interpreter\LightCompiler.cs (1)
288private readonly Stack<ParameterExpression> _exceptionForRethrowStack = new Stack<ParameterExpression>();
System\Linq\Expressions\Interpreter\TypeOperations.cs (1)
505private readonly Stack<HashSet<ParameterExpression>> _shadowedVars = new Stack<HashSet<ParameterExpression>>();
System\Runtime\CompilerServices\RuntimeOps.ExpressionQuoter.cs (1)
60private readonly Stack<HashSet<ParameterExpression>> _shadowedVars = new Stack<HashSet<ParameterExpression>>();
System.Private.CoreLib.Generators (2)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (2)
400Stack<INamedTypeSymbol> symbolsToExamine = new Stack<INamedTypeSymbol>(); 428Stack<INamedTypeSymbol> symbolsToExamine = new Stack<INamedTypeSymbol>();
System.Private.DataContractSerialization (2)
src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (1)
175var subTypeNames = new Stack<string>();
System\Runtime\Serialization\CodeGenerator.cs (1)
104private Stack<object> _blockStack = null!; // initialized in BeginMethod
System.Private.Windows.Core (1)
System\Private\Windows\Core\BinaryFormat\Deserializer\Deserializer.cs (1)
78private readonly Stack<ObjectRecordDeserializer> _parserStack = [];
System.Private.Xml (22)
System\Xml\Cache\XPathDocumentBuilder.cs (1)
41private readonly Stack<XPathNodeRef> _stkNmsp; // In-scope namespaces
System\Xml\Schema\ContentValidator.cs (5)
439Stack<InteriorNode> nodeStack = new Stack<InteriorNode>(); 494Stack<SequenceConstructPosContext> contextStack = new Stack<SequenceConstructPosContext>(); 569Stack<SequenceNode> nodeStack = new Stack<SequenceNode>(); 652Stack<ChoiceNode> nodeStack = new Stack<ChoiceNode>(); 1044private Stack<SyntaxTreeNode?>? _stack; // parsing context
System\Xml\Schema\DtdParser.cs (1)
1030Stack<ParseElementOnlyContent_LocalFrame> localFrames = new Stack<ParseElementOnlyContent_LocalFrame>();
System\Xml\Schema\DtdParserAsync.cs (1)
661Stack<ParseElementOnlyContent_LocalFrame> localFrames = new Stack<ParseElementOnlyContent_LocalFrame>();
System\Xml\Schema\SchemaCollectionCompiler.cs (1)
17private readonly Stack<XmlSchemaComplexType> _complexTypeStack = new Stack<XmlSchemaComplexType>();
System\Xml\Schema\SchemaSetCompiler.cs (1)
25private readonly Stack<XmlSchemaComplexType> _complexTypeStack = new Stack<XmlSchemaComplexType>();
System\Xml\Schema\XsdBuilder.cs (1)
630private readonly Stack<XmlSchemaObject> _containerStack = new Stack<XmlSchemaObject>();
System\Xml\Serialization\CodeGenerator.cs (3)
41private Stack<object>? _blockStack; 377private readonly Stack<Label> _leaveLabels = new Stack<Label>(); 1379private Stack<WhileState>? _whileStack;
System\Xml\XPath\Internal\PreSiblingQuery.cs (1)
49Stack<XPathNavigator> inputStk = new Stack<XPathNavigator>();
System\Xml\Xsl\Runtime\XmlQueryOutput.cs (1)
52private Stack<string>? _stkNames; // Keep stack of name parts computed during StartElement
System\Xml\Xsl\Runtime\XmlQueryRuntime.cs (1)
60private readonly Stack<XmlQueryOutput> _stkOutput;
System\Xml\Xsl\XPath\XPathParser.cs (1)
14private readonly Stack<int> _posInfo = new Stack<int>();
System\Xml\Xsl\Xslt\InvokeGenerator.cs (1)
25private readonly Stack<QilIterator> _iterStack;
System\Xml\Xsl\Xslt\QilGenerator.cs (1)
2854private readonly Stack<QilIterator> _vars = new Stack<QilIterator>();
System\Xml\Xsl\Xslt\XslAstAnalyzer.cs (1)
1237private Stack<Template>? _newTemplates;
System\Xml\Xsl\XsltOld\Compiler.cs (1)
73private Stack<Stylesheet>? _stylesheets;
System.Resources.Extensions (1)
System\Resources\Extensions\BinaryFormat\Deserializer\Deserializer.cs (1)
80private readonly Stack<ObjectRecordDeserializer> _parserStack = [];
System.Text.Json (5)
System\Text\Json\Serialization\Converters\Collection\IEnumerableConverterFactory.cs (1)
118else if ((actualTypeToConvert = typeToConvert.GetCompatibleGenericBaseClass(typeof(Stack<>))) != null)
System\Text\Json\Serialization\Converters\Collection\StackOfTConverter.cs (1)
11where TCollection : Stack<TElement>
System\Text\Json\Serialization\IgnoreReferenceResolver.cs (1)
12private Stack<ReferenceEqualsWrapper>? _stackForCycleDetection;
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Collections.cs (2)
239/// Creates serialization metadata for types assignable to <see cref="Stack{T}"/>. 250where TCollection : Stack<TElement>
System.Text.Json.SourceGeneration (1)
Helpers\KnownTypeSymbols.cs (1)
55public INamedTypeSymbol? StackOfTType => GetOrResolveType(typeof(Stack<>), ref _StackOfTType);
System.Text.RegularExpressions (9)
System\Text\RegularExpressions\RegexCompiler.cs (4)
125private Stack<LocalBuilder>? _int32LocalsPool; 127private Stack<LocalBuilder>? _readOnlySpanCharLocalsPool; 367private readonly Stack<LocalBuilder> _pool; 370internal RentedLocalBuilder(Stack<LocalBuilder> pool, LocalBuilder local)
System\Text\RegularExpressions\RegexNode.cs (1)
205var toExamine = new Stack<RegexNode>();
System\Text\RegularExpressions\Symbolic\BDD.cs (2)
250var toVisit = new Stack<BDD>(); 457var toVisit = new Stack<BDD>();
System\Text\RegularExpressions\Symbolic\MintermGenerator.cs (1)
92var stack = new Stack<PartitionTree>();
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (1)
37Stack<(RegexNode Node, DoublyLinkedList<SymbolicRegexNode<BDD>> Result, DoublyLinkedList<SymbolicRegexNode<BDD>>[]? ChildResults)> stack = new();
System.Text.RegularExpressions.Generator (2)
RegexGenerator.Emitter.cs (1)
46var parentClasses = new Stack<string>();
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (1)
205var toExamine = new Stack<RegexNode>();
System.Windows.Controls.Ribbon (1)
Microsoft\Windows\Controls\KeyTipService.cs (1)
1756private Stack<DependencyObject> _scopeStack = new Stack<DependencyObject>();
System.Windows.Forms (7)
System\Windows\Forms\Controls\ToolStrips\MergeHistory.cs (2)
8private Stack<MergeHistoryItem>? _mergeHistoryItemsStack; 15public Stack<MergeHistoryItem> MergeHistoryItemsStack
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (2)
53private Stack<MergeHistory>? _mergeHistoryStack; 1329internal Stack<MergeHistory> MergeHistoryStack
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (1)
766Stack<ToolStripDropDownItem> itemsStack = new();
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (2)
1145private static void MergeRecursive(ToolStripItem source, ToolStripItemCollection destinationItems, Stack<MergeHistoryItem> history) 1304Stack<ToolStrip> reApply = new();
System.Windows.Forms.Design (6)
System\ComponentModel\Design\DesignerHost.cs (1)
52private Stack<DesignerTransaction>? _transactions; // stack of transactions
System\ComponentModel\Design\DesignerHost.DesignerHostTransaction.cs (2)
35Stack<DesignerTransaction> transactions = _host._transactions!; 68Stack<DesignerTransaction> transactions = _host._transactions!;
System\ComponentModel\Design\UndoEngine.cs (1)
21private readonly Stack<UndoUnit> _unitStack; // the stack of active (non-committed) units.
System\Windows\Forms\Design\Behavior\BehaviorService.MenuCommandHandler.cs (1)
13private readonly Stack<CommandID> _currentCommands = new();
System\Windows\Forms\Design\TabOrder.cs (1)
28private readonly Stack<int> _controlIndices;
System.Xaml (14)
System\Xaml\Parser\GenericTypeNameParser.cs (1)
31Stack<TypeNameFrame> _stack;
System\Xaml\Parser\MeScanner.cs (3)
379Stack<char> bracketCharacterStack = _context.CurrentBracketModeParseParameters.BracketCharacterStack; 465Stack<char> bracketCharacterStack = 623internal Stack<char> BracketCharacterStack { get; set; }
System\Xaml\Parser\XamlScannerStack.cs (1)
28Stack<XamlScannerFrame> _stack;
System\Xaml\XamlMarkupExtensionWriter.cs (1)
14Stack<Node> nodes;
System\Xaml\XamlObjectReader.cs (5)
28Stack<MarkupInfo> nodes; 73Stack<HashSet<string>> namesInCurrentScope = new Stack<HashSet<string>>(); 223public override void EnsureNoDuplicateNames(Stack<HashSet<string>> namesInCurrentScope) 988public virtual void EnsureNoDuplicateNames(Stack<HashSet<string>> namesInCurrentScope) { } 1767public override void EnsureNoDuplicateNames(Stack<HashSet<string>> namesInCurrentScope)
System\Xaml\XamlXmlWriter.cs (3)
26Stack<Frame> namespaceScopes; 30Stack<List<XamlNode>> meNodesStack; 342Stack<Frame>.Enumerator enumerator = writer.namespaceScopes.GetEnumerator();
xunit.console (2)
CommandLine.cs (2)
13readonly Stack<string> arguments = new Stack<string>(); 494static KeyValuePair<string, string> PopOption(Stack<string> arguments)