Explanation:
This ensures a potential leak with SwiftUI and other systems using
Observation do not leak observation closures when the potential
Observable instances used are only weakly referenced inside the tracking
closure.
Scope:
This is limited to the runtime behavior of Observable types and has no
ABI or language level interactions.
Issues:
rdar://112167556
Original PRs:
https://github.com/swiftlang/swift/pull/79823https://github.com/swiftlang/swift/pull/82307
Risk:
Low - This is very targeted to just Observation, however it is a
behavioral change which does not make this a zero risk change.
Testing:
New unit tests were added to catch at least some of the potential cases
this issue can occur with.
This is the original spelling which was not accepted. We kept
it for a bit to give adopters time to switch but it's time to
remove it now.
(cherry picked from commit e108524d98)
- Explanation:
Makes as many of the `span`, `bytes`, `mutableSpan` and `mutableRawSpan`
properties as possible available to backdeployed targets. This is
possible when the implementation only relies on pre-existing code.
- Resolves: rdar://153654652 (https://forums.swift.org/t/80513)
- Risk: low
- Main branch PR: https://github.com/swiftlang/swift/pull/82598
- Reviewed by: @atrick
- Testing: existing tests
When the concurrency library's "is current global actor" hook is not
available, assume that we are already executing on the right global
actor. This mimics the behavior of earlier standard libraries when
faced with an isolated conformance, as well as dealing with odd
configurations where the code might not load the concurrency library
yet
At the moment, WebAssembly ends up in this configuration because we
don't run the initialization for the concurrency library. That makes
this also a workaround for issue #82682 / rdar://154762027.
**Explanation:** Replace some `precondition` usage that slipped into the
stdlib with `_precondition`
**Resolves:** rdar://152529291
**Main Branch PR:** #82641
**Risk:** Very Low.
**Reviewed By:** @Azoy
Cherry-pick from https://github.com/swiftlang/swift/pull/82641
When targeting a platform that predates the introduction of isolated
deinit, make a narrow exception that allows main-actor-isolated deinit
to work through a special, inlineable entrypoint that is
back-deployed. This implementation
1. Calls into the real implementation when available, otherwise
2. Checks if we're on the main thread, destroying immediately when
we are, otherwise
3. Creates a new task on the main actor to handle destruction.
This implementation is less efficient than the implementation in the
runtime, but allows us to back-deploy this functionality as far back
as concurrency goes.
Fixes rdar://151029118.
Musl's `clone()` wrapper returns `EINVAL` if you try to use `CLONE_THREAD`,
which seems a bit wrong (certainly it is in this particular application,
since we *really* don't care whether the thread is a valid C library
thread at this point).
Also properly support ELF images that are built with a base address other
than zero (this typically isn't an issue for dynamically linked programs,
as they will be relocated at runtime anyway, but for statically linked
binaries it's very common to set the base address to a non-zero value).
rdar://154282813