Skip to content

Conversation

@fboemer
Copy link
Contributor

@fboemer fboemer commented Dec 12, 2025

Fixup of #242

This replaces a number of withUnsafe blocks with use of the .span property. This was introduced in Swift 6.2, so it does require bumping the toolchain version and minimum Mac deployment target.

Some minor performance regressions should be anticipated, as there will now be bounds checks performed where previously these were compiled out with the use of unsafe buffers. These either should be accepted as the cost of memory safety, or investigated to see if tweaks to the code structure could help the compiler eliminate them.


CI / swifttests / Linux ( - - aarch64) (pull_request) CI failure seems to result from https://github.com/swiftlang/github-workflows/pull/207/files, perhaps to be fixed in swiftlang/github-workflows#210.

We also enable breaking API changes, which correctly detects:

2 breaking changes detected in HomomorphicEncryption:
  💔 API breakage: func Array2d.withUnsafeData(_:) has been removed
  💔 API breakage: func Array2d.withUnsafeMutableData(_:) has been removed

@fboemer fboemer force-pushed the fboemer/spanify-unsafe branch 4 times, most recently from 654ce98 to b15242c Compare December 12, 2025 18:51
@fboemer fboemer added the ⚠️ semver/major Breaks existing public API label Dec 12, 2025
@fboemer fboemer changed the title Fboemer/spanify unsafe Replace unsafe iteration with use of Span Dec 12, 2025
@fboemer fboemer marked this pull request as ready for review December 12, 2025 19:08
Copy link
Contributor

@karulont karulont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fboemer fboemer merged commit 4ecb39c into main Dec 15, 2025
16 of 17 checks passed
@fboemer fboemer deleted the fboemer/spanify-unsafe branch December 15, 2025 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚠️ semver/major Breaks existing public API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants