Skip to content

Commit 7ae80e0

Browse files
authored
Add LargeData internal initializer entrypoint (#1538) (#1553)
1 parent 32fd38c commit 7ae80e0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Sources/FoundationEssentials/Data/Data.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,12 @@ public struct Data : Equatable, Hashable, RandomAccessCollection, MutableCollect
11651165
self.storage = storage
11661166
self.slice = RangeReference(0..<count)
11671167
}
1168+
1169+
// Not exposed as ABI and only usable by internal, non-inlined code and therefore not @inlinable
1170+
init(_ storage: __DataStorage, range: Range<Int>) {
1171+
self.storage = storage
1172+
self.slice = RangeReference(range)
1173+
}
11681174

11691175
@inlinable // This is @inlinable as trivially computable (and inlining may help avoid retain-release traffic).
11701176
mutating func ensureUniqueReference() {

0 commit comments

Comments
 (0)