[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:
Dave Abrahams
2014-05-05 23:21:47 +00:00
parent 0c46eb821e
commit 3606513c36

View File

@@ -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) {