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

Remove calls to empty RuntimeHelpers.PrepareConstrainedRegions() #33179

Closed
danmoseley opened this issue Mar 4, 2020 · 5 comments
Closed

Remove calls to empty RuntimeHelpers.PrepareConstrainedRegions() #33179

danmoseley opened this issue Mar 4, 2020 · 5 comments
Assignees
Labels
area-Meta good first issue Issue should be easy to implement, good for first-time contributors help wanted [up-for-grabs] Good issue for external contributors untriaged New issue has not been triaged by the area owner

Comments

@danmoseley
Copy link
Member

There are ~140 calls to RuntimeHelpers.PrepareConstrainedRegions(). In .NET Core this has no implementation. The calls can be removed.

https://source.dot.net/#System.Private.CoreLib/RuntimeHelpers.cs,5bb48d7700e1ad2e,references

(Except in libraries that we still ship for .NET Framework, except I don't believe any of these are calls from those.)

@danmoseley danmoseley added area-Meta good first issue Issue should be easy to implement, good for first-time contributors help wanted [up-for-grabs] Good issue for external contributors labels Mar 4, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Mar 4, 2020
@danmoseley
Copy link
Member Author

@stephentoub just curious are you aware of an analyzer that flags calls to empty methods (I realize it could be noisy)

@stephentoub
Copy link
Member

just curious are you aware of an analyzer that flags calls to empty methods (I realize it could be noisy)

I'm not aware of one, though it's possible there is somewhere. Unless such an analyzer is cracking open the IL of a referenced assembly, it's not clear how much value it would provide, since it would be for only the same assembly. And even if it was reading the IL of the called method, it would have difficulty with reference assemblies, which may have a lot of empty methods that aren't actually empty at run time. On that note, even in an assembly such an analyzer could be quite noisy, e.g. we have partial classes that in one build calls a method that does something meaningful and in another build calls an empty version of that same method.

@danmoseley
Copy link
Member Author

True..

@Marusyk
Copy link
Member

Marusyk commented Mar 4, 2020

Please assing it to me

@danmoseley
Copy link
Member Author

@Marusyk it's all yours!

@jkotas jkotas closed this as completed in 8f99208 Mar 16, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Meta good first issue Issue should be easy to implement, good for first-time contributors help wanted [up-for-grabs] Good issue for external contributors untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

4 participants