File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,14 @@ func _allocateUninitializedArray<Element>(_ builtinCount: Builtin.Word)
4141 if count > 0 {
4242 // Doing the actual buffer allocation outside of the array.uninitialized
4343 // semantics function enables stack propagation of the buffer.
44+ let storageType : _ContiguousArrayStorage < Element > . Type
45+ #if !$Embedded
46+ storageType = getContiguousArrayStorageType ( for: Element . self)
47+ #else
48+ storageType = _ContiguousArrayStorage< Element> . self
49+ #endif
4450 let bufferObject = Builtin . allocWithTailElems_1 (
45- getContiguousArrayStorageType ( for: Element . self) ,
46- builtinCount, Element . self)
51+ storageType, builtinCount, Element . self)
4752
4853 let ( array, ptr) = Array< Element> . _adoptStorage( bufferObject, count: count)
4954 return ( array, ptr. _rawValue)
Original file line number Diff line number Diff line change @@ -297,9 +297,14 @@ internal struct _ContiguousArrayBuffer<Element>: _ArrayBufferProtocol {
297297 self = _ContiguousArrayBuffer < Element > ( )
298298 }
299299 else {
300+ let storageType : _ContiguousArrayStorage < Element > . Type
301+ #if !$Embedded
302+ storageType = getContiguousArrayStorageType ( for: Element . self)
303+ #else
304+ storageType = _ContiguousArrayStorage< Element> . self
305+ #endif
300306 _storage = Builtin . allocWithTailElems_1 (
301- getContiguousArrayStorageType ( for: Element . self) ,
302- realMinimumCapacity. _builtinWordValue, Element . self)
307+ storageType, realMinimumCapacity. _builtinWordValue, Element . self)
303308
304309 let storageAddr = UnsafeMutableRawPointer ( Builtin . bridgeToRawPointer ( _storage) )
305310 let allocSize : Int ?
You can’t perform that action at this time.
0 commit comments