Skip to content

Avoid malloc allocations in the runtime, part 2 #23249

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

Merged
merged 7 commits into from
Mar 14, 2019

Conversation

eeckstein
Copy link
Contributor

This is a followup on #23131.

Removes even more memory allocations in the runtime. The most significant changes are:

  • making the old remangler allocation-free
  • avoid memory allocations in checkTransitiveCompleteness

See the commit messages for details.

@eeckstein
Copy link
Contributor Author

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - d096fdaded2b33f776641c4d01a9171466da845f

…e old remangler

The old remangler is only used for ObjC runtime type mangling, but not for mangling optimized function names.
Extract common code from the old and new remangler into a common base class.
This lets the old remangler benefit from the changes I did recently in the new remangler.
Use SmallVector instead of std::vector and a SmallPtrSet-like implementation for the set.
@eeckstein eeckstein force-pushed the runtime-malloc-removal2 branch from d096fda to c6abbfa Compare March 13, 2019 18:50
@eeckstein
Copy link
Contributor Author

@swift-ci test

1 similar comment
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein
Copy link
Contributor Author

@swift-ci test macOS

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - d096fdaded2b33f776641c4d01a9171466da845f

@eeckstein eeckstein merged commit ece3634 into swiftlang:master Mar 14, 2019
@eeckstein eeckstein deleted the runtime-malloc-removal2 branch March 14, 2019 15:47
@rjmccall
Copy link
Contributor

There are a lot of unnecessary changes in this patch — renaming Out to Buffer, moving methods around in the demangler — that make it harder to review. If you felt these were valuable (and I'm not trying to argue they weren't), you could've made them in a separate NFC PR.

@rjmccall
Copy link
Contributor

That said, LGTM, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants