Intrinsic support for pinning.

Using the intrinsics is obnoxious because I needed them
to return Builtin.NativeObject?, but there's no reasonable
way to safely generate optional types from Builtins.cpp.
Ugh.

Dave and I also decided that there's no need for
swift_tryPin to allow a null object.

Swift SVN r23824
This commit is contained in:
John McCall
2014-12-10 00:52:48 +00:00
parent d513803d84
commit 3b4e0d307e
24 changed files with 322 additions and 10 deletions

View File

@@ -303,7 +303,7 @@ void swift::swift_weakRelease(HeapObject *object) {
}
HeapObject *swift::swift_tryPin(HeapObject *object) {
if (!object) return nullptr;
assert(object);
// Try to set the flag. If this succeeds, the caller will be
// responsible for clearing it.