Exposing the raw baseAddress without lifetime control is error-prone.
Began to strip actual uses of baseAddress from specific models of
_ArrayBufferType, too.
Swift SVN r22950
The indenter does great until it sees the Python triple-quoted string
containing a swift string with a string intepolation inside; that brings
it out to quotation level zero and then the backslash escapes the open
paren causing the nesting level to go negative when it sees the close
paren. Sheesh.
Swift SVN r22948
This is mostly just a renaming of _SwiftNativeNSArray, except that we
want to add another NSArray subclass for verbatim-bridged elements, so
we want a common base class. _SwiftNativeNSArray is the name of that
new base class, to parallel the other _SwiftNativeNSXXX classes.
Swift SVN r22913
We're going to replace StdlibUnittest's use of ContiguousArray with
_UnitTestArray so that we can work on (and potentially break)
_ContiguousArray and still get useful test results. When refactoring is
complete, we can optionally replace StdlibUnittest's use of
_UnitTestArray with ContiguousArray, or move the decoupled component
into the StdlibUnittest module.
Swift SVN r22874
Fixes rdar://problem/18646425
Running the test uncovered avoidable inefficiencies in Array copying, so
dispatch of _copyToNativeArrayBuffer was revamped. It's reasonable to
expect some speedups from this.
Also, the internal Array API requestNativeBuffer was highly error prone
when the source was a Slice, because it could return an array buffer
that represented more than the entire slice. That capability was
probably used for optimization once, but is no longer, and the error
prone API probably caused bugs, so it was reformed.
Swift SVN r22746
This speeds up empty array literals and fixes the performance regression in the Havlak benchmark.
See <rdar://problem/18480488> PerfReg: Havlak - Megaclang - r353047-r353195 - 3x
Swift SVN r22427
The name was not only long and unwieldy, but inconsistent with our
conscious decision to avoid the use of "elements" in APIs as mostly
redundant.
Swift SVN r22408
This avoids a pointless copy every time an array literal is written, and will let us retire the horrible "alloc_array" instruction and globs of broken IRGen code. Implements rdar://problem/16386862, and probably fixes a bunch of bugs related to alloc_array brokenness.
Swift SVN r22289
That commit made a protocol public. The protocol was underscored but
some of its APIs were not, and those became unintentionally publicly
visible. This commit corrects that problem. Since Builtin.RawPointer
properties were being renamed from "value" to "_rawValue" for clarity,
COpaquePointer got that treatment too, even though it wasn't strictly
necessary, for consistency.
Swift SVN r22252
240 undocumented public non-operator APIs remain in core
Note: previous estimates were wrong because my regex was broken. The
previous commit, for example, had 260 undocumented APIs.
Swift SVN r22234
A collection whose count changes between traversals could cause a memory
safety problem, as we would measure the collection in one pass and
assume that it was the same length when actually initializing array
elements. Fix that by always using the initial measurement, which
corresponds exactly to allocated memory. If the collection wants to
trap because we've gone past its new bounds, that's fine. If it
doesn't, at least we haven't done anything unsafe.
Swift SVN r22152
Replaced the general implementation (which works for all array types) to the obvious and trivial implementation for Array.
This speeds up array literal initialization by about 2x.
Swift SVN r21626
The buffer argument of _arrayReplace was a protocol and it forced
all of the calls to that member to be virtually dispatched and generic.
This boosts DeltaBlue by 2X.
Swift SVN r21405
To limit user confusion when using conditional expressions of type Bool?, we've decided to remove the BooleanType (aka "LogicValue") conformance from optional types. (If users would like to use an expression of type Bool? as a conditional, they'll need to check against nil.)
Note: This change effectively regresses the "case is" pattern over types, since it currently demands a BooleanType conformance. I've filed rdar://problem/17791533 to track reinstating it if necessary.
Swift SVN r20637
In answering a forum post I noiced that I wanted this and it was
missing.
Also, extensive comments
Also, rename the length: init parameter to count:. When writing the
comments for the init function it became painfully clear why we use
"count" is better than "length" especially around pointers and memory:
the former is much less easy to mistake for "length in bytes". Plus
it's consistent with the new ".count" property
Swift SVN r20609
Array literal construction currently goes through an expensive dance;
Adding _allocateUninitialized will allow SILGen to do something much
smarter.
Swift SVN r20448
This way, array optimization can see initialization as a copy of the
whole array value into a local variable, regardless of whether it's
from a factory method or Array initializer.
I'm making an assumption that when we return an Array by value, we
can't have an alias of the array buffer without retaining it.
Swift SVN r20444
Ultimately this gets to HeapBuffer which checks the index is in range by separately checking whether the storage is nil, then the index is less than the count
Swift SVN r20363