mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[embedded] Add swift_allocEmptyBox to the embedded runtime
This commit is contained in:
@@ -236,6 +236,15 @@ func swift_initStackObject(metadata: UnsafeMutablePointer<ClassMetadata>, object
|
||||
return unsafe object
|
||||
}
|
||||
|
||||
@unsafe
|
||||
public var _emptyBoxStorage: (Int, Int) = (/*isa*/0, /*refcount*/-1)
|
||||
|
||||
@_cdecl("swift_allocEmptyBox")
|
||||
public func swift_allocEmptyBox() -> Builtin.RawPointer {
|
||||
let box = unsafe Builtin.addressof(&_emptyBoxStorage)
|
||||
swift_retain(object: box)
|
||||
return box
|
||||
}
|
||||
|
||||
|
||||
/// Refcounting
|
||||
|
||||
Reference in New Issue
Block a user