Skip to content

libSyntax: avoid copying token text when lexing token syntax nodes, NFC. #12723

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 1 commit into from
Nov 2, 2017
Merged

libSyntax: avoid copying token text when lexing token syntax nodes, NFC. #12723

merged 1 commit into from
Nov 2, 2017

Conversation

nkcsgexi
Copy link
Contributor

@nkcsgexi nkcsgexi commented Nov 2, 2017

This is likely the root cause for the memory surge when we always turn on
syntax token lexing. Since the underlying buffer outlives the syntax
tree, it's reasonable to refer the text instead of copying and owning it.

This is likely the root cause for memory surge when we always turn on
syntax token lexing. Since the underlying buffer outlives the syntax
tree, it's reasonable to refer the text instead of copying and owning it.
@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Nov 2, 2017

@swift-ci please smoke test

@nkcsgexi nkcsgexi merged commit 7981630 into swiftlang:master Nov 2, 2017
@nkcsgexi nkcsgexi deleted the copy-string-lib-syntax branch November 2, 2017 21:04
nkcsgexi added a commit that referenced this pull request Nov 3, 2017
* Re-apply "libSyntax: Ensure round-trip printing when we build syntax tree from parser incrementally. (#12709)"

* Re-apply "libSyntax: Root parsing context should hold a reference to the current token in the parser, NFC."

* Re-apply "libSyntax: avoid copying token text when lexing token syntax nodes, NFC. (#12723)"

* Actually fix the container-overflow issue.
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.

1 participant