File tree 2 files changed +14
-4
lines changed 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)
41
41
if count > 0 {
42
42
// Doing the actual buffer allocation outside of the array.uninitialized
43
43
// 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
44
50
let bufferObject = Builtin . allocWithTailElems_1 (
45
- getContiguousArrayStorageType ( for: Element . self) ,
46
- builtinCount, Element . self)
51
+ storageType, builtinCount, Element . self)
47
52
48
53
let ( array, ptr) = Array< Element> . _adoptStorage( bufferObject, count: count)
49
54
return ( array, ptr. _rawValue)
Original file line number Diff line number Diff line change @@ -297,9 +297,14 @@ internal struct _ContiguousArrayBuffer<Element>: _ArrayBufferProtocol {
297
297
self = _ContiguousArrayBuffer < Element > ( )
298
298
}
299
299
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
300
306
_storage = Builtin . allocWithTailElems_1 (
301
- getContiguousArrayStorageType ( for: Element . self) ,
302
- realMinimumCapacity. _builtinWordValue, Element . self)
307
+ storageType, realMinimumCapacity. _builtinWordValue, Element . self)
303
308
304
309
let storageAddr = UnsafeMutableRawPointer ( Builtin . bridgeToRawPointer ( _storage) )
305
310
let allocSize : Int ?
You can’t perform that action at this time.
0 commit comments