mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Remove TwoWordPair and use SwiftCC instead.
This commit is contained in:
@@ -210,7 +210,7 @@ public:
|
||||
|
||||
static SimpleGlobalCache<BoxCacheEntry> Boxes;
|
||||
|
||||
BoxPair::Return swift::swift_makeBoxUnique(OpaqueValue *buffer, const Metadata *type,
|
||||
BoxPair swift::swift_makeBoxUnique(OpaqueValue *buffer, const Metadata *type,
|
||||
size_t alignMask) {
|
||||
auto *inlineBuffer = reinterpret_cast<ValueBuffer*>(buffer);
|
||||
HeapObject *box = reinterpret_cast<HeapObject *>(inlineBuffer->PrivateData[0]);
|
||||
@@ -222,8 +222,8 @@ BoxPair::Return swift::swift_makeBoxUnique(OpaqueValue *buffer, const Metadata *
|
||||
auto *oldObjectAddr = reinterpret_cast<OpaqueValue *>(
|
||||
reinterpret_cast<char *>(box) + headerOffset);
|
||||
// Copy the data.
|
||||
type->vw_initializeWithCopy(refAndObjectAddr.second, oldObjectAddr);
|
||||
inlineBuffer->PrivateData[0] = refAndObjectAddr.first;
|
||||
type->vw_initializeWithCopy(refAndObjectAddr.buffer, oldObjectAddr);
|
||||
inlineBuffer->PrivateData[0] = refAndObjectAddr.object;
|
||||
// Release ownership of the old box.
|
||||
swift_release(box);
|
||||
return refAndObjectAddr;
|
||||
@@ -235,11 +235,12 @@ BoxPair::Return swift::swift_makeBoxUnique(OpaqueValue *buffer, const Metadata *
|
||||
}
|
||||
}
|
||||
|
||||
BoxPair::Return swift::swift_allocBox(const Metadata *type) {
|
||||
BoxPair swift::swift_allocBox(const Metadata *type) {
|
||||
return _swift_allocBox(type);
|
||||
}
|
||||
|
||||
static BoxPair::Return _swift_allocBox_(const Metadata *type) {
|
||||
SWIFT_CC(swift)
|
||||
static BoxPair _swift_allocBox_(const Metadata *type) {
|
||||
// Get the heap metadata for the box.
|
||||
auto metadata = &Boxes.getOrInsert(type).first->Data;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user