Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Oct 8, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

pawelmajcher and others added 4 commits October 8, 2025 15:45
On platforms targeting Swift 6.2 and later this allows a `RawSpan` in
lieu of `SwiftProtobufContiguousBytes`-conforming type when creating or
merging a protobuf message. This will improve memory usage by reducing
allocations, for example when parsing a large document that includes
protobuf messages as part of its binary. Unlike the internal `_merge`
function, this does not expose unsafe API while retaining its benefits.

- I decided to make a twin declaration of the initializer and `merge`
function instead of conforming `RawSpan` to
`SwiftProtobufContiguousTypes`, because
  - a) `RawSpan` is not mutable, and
  - b) `Span` types are non-owning and cannot conform to initializers.
- I used the conditional compilation block and `@available` directive
per ~~analogy to [this implementation in
SwiftNIO](https://github.com/apple/swift-nio/blob/main/Sources/NIOCore/ByteBuffer-core.swift#L1066)~~
[docs](https://developer.apple.com/documentation/swift/rawspan).

---------

Co-authored-by: Franz Busch <[email protected]>
- Call out clicking edit.
- Ensure the protoc release doesn't get counted as the "latest" for the
repo.
The `Span` support was a _minor_ bump, so left that out of the previous
release so folks would get the assertion fix if they were only accepting
bug fixes.
@pull pull bot locked and limited conversation to collaborators Oct 8, 2025
@pull pull bot added the ⤵️ pull label Oct 8, 2025
@pull pull bot merged commit c6fe644 into makesoftwaresafe:main Oct 8, 2025
1 check failed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants