mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] Factor out _fixLifetime
Apparently Builtin.fixLifetime isn't yet respected (<rdar://problem/16464507>) and calls to that and swift_keepAlive were getting scattered around randomly. Let's have a convenient library function instead. Swift SVN r17493
This commit is contained in:
@@ -333,10 +333,7 @@ void swift::swift_deallocObject(HeapObject *object, size_t allocatedSize) {
|
||||
|
||||
/// This is a function that is opaque to the optimizer. It is called to ensure
|
||||
/// that an object is alive at least until that time.
|
||||
extern "C" void swift_keepAlive(HeapObject *object) {
|
||||
// Parameters are passed at +1 reference count. We need to release to
|
||||
// balance.
|
||||
swift_release(object);
|
||||
extern "C" void swift_keepAlive(OpaqueValue* value, const Metadata* t) {
|
||||
}
|
||||
|
||||
void swift::swift_weakInit(WeakReference *ref, HeapObject *value) {
|
||||
|
||||
Reference in New Issue
Block a user