Move ArrayBuilder.GetInstance helpers to Microsoft.CodeAnalysis.PooledObjects package#76971
Move ArrayBuilder.GetInstance helpers to Microsoft.CodeAnalysis.PooledObjects package#76971tmat merged 5 commits intodotnet:mainfrom
Conversation
| @@ -8,9 +8,7 @@ | |||
| namespace Microsoft.CodeAnalysis.PooledObjects; | |||
|
|
|||
| [NonCopyable] | |||
There was a problem hiding this comment.
Adds [NonCopyable] attribute to the type definition.
There was a problem hiding this comment.
What about just requiring the consumer to provide this attribute in all cases?
There was a problem hiding this comment.
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.
#76997 (Add Microsoft.CodeAnalysis.Contracts source package)
|
@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.