mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] Kill _swift_isUniquelyReferenced @asmname
Swift SVN r22576
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <unistd.h>
|
||||
#include "../shims/RuntimeShims.h"
|
||||
|
||||
using namespace swift;
|
||||
|
||||
@@ -523,11 +524,15 @@ void swift::_swift_abortRetainUnowned(const void *object) {
|
||||
swift::crash("attempted to retain deallocated object");
|
||||
}
|
||||
|
||||
// Given the bits of a Native swift object reference, or of a
|
||||
// word-sized Swift enum containing a Native swift object reference as
|
||||
// a payload, return true iff the object's strong reference count is
|
||||
// 1.
|
||||
extern "C" bool _swift_isUniquelyReferenced(std::uintptr_t bits) {
|
||||
//===----------------------------------------------------------------------===//
|
||||
// FIXME: this should return bool but it chokes the compiler
|
||||
// <rdar://problem/18573806>
|
||||
//===----------------------------------------------------------------------===//
|
||||
/// Given the bits of a Native swift object reference, or of a
|
||||
/// word-sized Swift enum containing a Native swift object reference as
|
||||
/// a payload, return true iff the object's strong reference count is
|
||||
/// 1.
|
||||
unsigned char swift::_swift_isUniquelyReferenced(std::uintptr_t bits) {
|
||||
const auto object = reinterpret_cast<HeapObject*>(
|
||||
bits & ~heap_object_abi::SwiftSpareBitsMask);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user