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

Disable RTTI #3422

Merged
merged 6 commits into from
Jul 10, 2023
Merged

Disable RTTI #3422

merged 6 commits into from
Jul 10, 2023

Conversation

JohnMcPMS
Copy link
Member

@JohnMcPMS JohnMcPMS commented Jul 10, 2023

Fixes #2015

Change

Disable RTTI (run-time type information) in almost all native projects. The only uses of it were in IPackage and ISource dynamic casts, so explicit implementations were created for these to allow them to continue to function as before. Helper templates allow replacing dynamic_cast with PackageCast and std::dynamic_pointer_cast with SourceCast directly.

The file size dropped ~800 KB on ~5000 KB, which is about a 15% reduction in size.

Validation

Current tests should validate that we do not hit any new UB due to using a feature that should not work (although std::dynamic_pointer_cast actually fails to compile with RTTI disabled, so hopefully everything is covered in MS VC).

Microsoft Reviewers: codeflow:open?pullrequest=#3422

@JohnMcPMS JohnMcPMS requested a review from a team as a code owner July 10, 2023 19:08
@microsoft-github-policy-service microsoft-github-policy-service bot added the Issue-Feature This is a feature request for the Windows Package Manager client. label Jul 10, 2023
@JohnMcPMS JohnMcPMS merged commit b82cf60 into microsoft:master Jul 10, 2023
@JohnMcPMS JohnMcPMS deleted the remove-rtti branch July 10, 2023 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Feature This is a feature request for the Windows Package Manager client.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WindowsPackageManager.dll size could be shrunk significantly by disabling RTTI
2 participants