As proposed in SE-0107: UnsafeRawPointer:
Rename 'init(allocatingCapacity:)' to 'UnsafeMutablePointer.allocate(capacity:)'
Rename 'deallocateCapacity' to 'deallocate(capacity:)'
`allocate` should not be an initializer. It's primary function is to allocate
memory, not initialize a pointer.
pthreads is not available on non-POSIX platforms (i.e. Windows). Restrict the
target platforms that we build SwiftPrivatePthreadExtras and things which depend
on it.
Changes:
- Added bounds checks to Unsafe*BufferPointer's subscript getter and setter
- Added tests for Unsafe*BufferPointer's subscript getter for all four range types
Changes:
- Parameterized a number of tests in CheckCollectionType.swift.gyb expected to crash during one or more runthroughs
- Fixed an issue with the tests uncovered by this change
Changes:
- Moved only-used-once helper methods into call sites
- Parameterized tests that might expect a crash
- Fixed some comments and formatting; renamed some test helper APIs
* [stdlib] Adding new tests for collection indices
Changes:
- Added tests for 'index(next:)'
- Added tests for all 'formIndex' API variants
- Modified existing tests to better test bidirectional collections
* Fixes reflecting review feedback
As a first step to allowing the build script to build *only*
static library versions of the stdlib, change `add_swift_library`
such that callers must pass in `SHARED`, `STATIC`, or `OBJECT_LIBRARY`.
Ideally, only these flags would be used to determine whether to
build shared, static, or object libraries, but that is not currently
the case -- `add_swift_library` also checks whether the library
`IS_STDLIB` before performing certain additional actions. This will be
cleaned up in a future commit.
... as well as new test collection types:
`MinimalRandomAccessCollectionWithStrideableIndex` and
`DefaultedRandonAccessCollectionWithStrideableIndex`, to test default
implementation of `index(...)` family of functions provided by the
standard library for the random access collections with strideable
indices.
Removing the “checksAdded” parameter from collection unit tests and
simply sharing a global variable is a better way to go. We don't
use threads at that level, so there's no thread safety issue, and we
already committed to globals when we introduced the logging wrappers.