apple / swift-atomics

Low-level atomic operations for Swift
Apache License 2.0
1.06k stars 50 forks source link

[_AtomicShims] On Darwin, call swift_retain_n/swift_release_n via dlsym #95

Closed lorentey closed 1 year ago

lorentey commented 1 year ago

This avoids a linker failure when the build system decides to build this module as a standalone library.

Hopefully this will all go away soon, when swift_retain_n/swift_release_n will become primitives exposed by the stdlib.

rdar://108390931

Checklist

lorentey commented 1 year ago

@swift-ci test

lorentey commented 1 year ago

Quick search indicates that it's okay, at least as long as dlopen/dlsym is only used to load specific, hardwired symbols from public libraries. So it appears this will be fine.

lorentey commented 1 year ago

Closing in favor of #97.