Skip to content

Conversation

@egorzhdan
Copy link
Contributor

@egorzhdan egorzhdan commented Jun 6, 2023

Explanation: This improves the performance of initializing a Swift Collection such as Swift.Array from a C++ container by avoiding excessive copies of the C++ container.
Scope: This adds attributes to two initializers declared in the Cxx module, which is only visible when C++ interop is enabled.
Risk: Low, this only has an effect when C++ interop is enabled.

rdar://110110376

egorzhdan added 2 commits June 6, 2023 23:21
…ion should not copy the collection

This makes the `CxxConvertibleToCollection` parameter shared, preventing the unnecessary copy of the C++ value.

rdar://110110376
(cherry picked from commit cf8ac14)
@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Jun 6, 2023
@egorzhdan egorzhdan requested a review from a team as a code owner June 6, 2023 22:23
@egorzhdan
Copy link
Contributor Author

@swift-ci please test

@egorzhdan egorzhdan merged commit fdc89ab into release/5.9 Jun 7, 2023
@egorzhdan egorzhdan deleted the egorzhdan/5.9-borrow-cxx-convertible branch June 7, 2023 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ interop Feature: Interoperability with C++

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants