Revert "Revert "Isolated synchronous deinit""

This commit is contained in:
Konrad `ktoso` Malawski
2024-09-17 17:35:38 +09:00
parent 8fe0fd1781
commit 7d1ce789ad
88 changed files with 4219 additions and 502 deletions

View File

@@ -320,7 +320,13 @@ public func swift_bridgeObjectRelease_n(object: Builtin.RawPointer, n: UInt32) {
swift_release_n(object: untaggedObject, n: n)
}
@_cdecl("swift_retainCount")
public func swift_retainCount(object: Builtin.RawPointer) -> Int {
if !isValidPointerForNativeRetain(object: object) { return 0 }
let o = UnsafeMutablePointer<HeapObject>(object)
let refcount = refcountPointer(for: o)
return loadAcquire(refcount) & HeapObject.refcountMask
}
/// Refcount helpers