mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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.
732 B
732 B