-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[libSyntax] Reference count SyntaxData #36230
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
Conversation
@swift-ci Please test |
1873d23
to
8ed3ea4
Compare
@swift-ci Please test Linux |
8ed3ea4
to
88e9048
Compare
Full testing passed before rebasing onto @swift-ci Please smoke test |
@swift-ci Please test Windows |
Instead of having a heap-allocated RefCountedBox to store a SyntaxData's parent, reference-count SyntaxData itself. This has a couple of advantages: - When passing SyntaxData around, only a pointer needs to be passed instead of the entire struct contents. This is faster. - We can later introduce a SyntaxDataRef, which behaves similar to SyntaxData, but delegates the responsibility that the parent stays alive to the user. While sacrificing guaranteed memory safety, this means that SyntaxData can then be stack-allocated without any ref-counting overhead.
88e9048
to
56a9234
Compare
And another rebase onto @swift-ci Please smoke test |
@swift-ci Please test |
Build failed |
@swift-ci Please test Linux |
Build failed |
@swift-ci Please smoke test Linux |
Instead of having a heap-allocated
RefCountedBox
to store aSyntaxData
's parent, reference-countSyntaxData
itself. This has a couple of advantages:SyntaxData
around, only a pointer needs to be passed instead of the entire struct contents. This is faster.SyntaxDataRef
, which behaves similar toSyntaxData
, but delegates the responsibility that the parent stays alive to the user. While sacrificing memory safety, this means thatSyntaxData
can then be stack-allocated without any ref-counting overhead.