Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move ArrayBuilder.GetInstance helpers to Microsoft.CodeAnalysis.PooledObjects package #76971

Merged
merged 5 commits into from
Feb 7, 2025

Conversation

tmat
Copy link
Member

@tmat tmat commented Jan 30, 2025

These helpers are generally useful to consumers of the package. Especially when combining Roslyn source packages - see #76937

They were defined in Workspace layer since we do not want to allow using them in the compiler (due to perf concerns when used widely). To keep this intentional constraint the change adds them to compiler-specific banned API list.

@tmat tmat requested review from a team as code owners January 30, 2025 03:54
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Jan 30, 2025
@@ -8,9 +8,7 @@
namespace Microsoft.CodeAnalysis.PooledObjects;

[NonCopyable]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds [NonCopyable] attribute to the type definition.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about just requiring the consumer to provide this attribute in all cases?

Copy link
Member Author

@tmat tmat Feb 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the analyzer Roslyn specific? I would rather not impose more requirements on consumers of this source package.

That said, I'm working on another source package (say Microsoft.CodeAnalysis.Contracts) with basic contracts and exception utilities, which are used by our threading utilities (extracted to source package #76937).

We can include NonCopyable there. It's a contract after all, so it would fit.

Copy link
Member Author

@tmat tmat Feb 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#76997 (Add Microsoft.CodeAnalysis.Contracts source package)

Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@jaredpar
Copy link
Member

jaredpar commented Feb 6, 2025

@333fred PTAL

@tmat tmat merged commit 4253f32 into dotnet:main Feb 7, 2025
28 checks passed
@tmat tmat deleted the PooledObjects branch February 7, 2025 03:47
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Feb 7, 2025
@akhera99 akhera99 modified the milestones: Next, 17.14 P2 Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants