mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user