21 references to ToArrayAndFree
Microsoft.CodeAnalysis (14)
CommandLine\CommandLineParser.cs (2)
430return result.ToArrayAndFree(); 1065return builder.ToArrayAndFree().Select(static x => x.ToString());
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (2)
357return builder.ToArrayAndFree(); 693return builder.ToArrayAndFree();
MetadataReader\MetadataHelpers.cs (4)
292nestedTypesBuilder?.ToArrayAndFree(), 295arrayRanksBuilder?.ToArrayAndFree(), 370return typeBuilder.ToArrayAndFree(); 378return typeBuilder.ToArrayAndFree();
ReferenceManager\CommonReferenceManager.Binding.cs (1)
494referenceBindings[0] = bindingsOfAssemblyBeingBuilt.ToArrayAndFree();
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (1)
867var block = builder.ToArrayAndFree();
Symbols\Attributes\AttributeUsageInfo.cs (1)
166return new ValidTargetsStringLocalizableErrorArgument(builder.ToArrayAndFree());
Syntax\GreenNodeExtensions.cs (3)
40return (TNode)node.SetAnnotations(newAnnotations.ToArrayAndFree()); 71return (TNode)node.SetAnnotations(newAnnotations.ToArrayAndFree()); 102return (TNode)node.SetAnnotations(newAnnotations.ToArrayAndFree());
Microsoft.CodeAnalysis.CSharp (7)
Binder\Binder.cs (1)
913return binders.ToArrayAndFree();
CommandLine\CSharpCommandLineParser.cs (1)
1785return builder.ToArrayAndFree();
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (1)
167return builder == null ? Array.Empty<XNode>() : builder.ToArrayAndFree();
FlowAnalysis\NullableWalker.cs (1)
3981nestedVisitResults: resultBuilder.ToArrayAndFree());
Parser\LanguageParser_InterpolatedString.cs (2)
71return diagnosticsBuilder.ToArrayAndFree(); 616return builder.ToArrayAndFree();
Symbols\Synthesized\RefKindVector.cs (1)
139var bitVector = BitVector.FromWords(firstWord.Value, otherWords?.ToArrayAndFree() ?? Array.Empty<ulong>(), capacity * BitsPerRefKind);