[embedded] Add swift_allocEmptyBox to the embedded runtime

This commit is contained in:
Kuba Mracek
2025-04-21 15:47:34 -07:00
parent e9253b749f
commit c0ea02f86d
2 changed files with 33 additions and 0 deletions

View File

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