-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Conversation
@@ -8,9 +8,7 @@ | |||
namespace Microsoft.CodeAnalysis.PooledObjects; | |||
|
|||
[NonCopyable] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@333fred PTAL |
b9bebe9
to
089bcfd
Compare
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.