- Hash seed randomization can now be disabled by defining the SWIFT_DETERMINISTIC_HASHING environment value with a value of "1".
- The random hash seed is now generated using arc4random, where available. On platforms where it isn't, don't construct std::random_device twice.
- _Hasher._secretKey is renamed _Hashing._seed, with no setter.
- _Hasher._isDeterministic is a new property exposing whether we're running with non-random hashes. (Set/Dictionary will need this information to decide if they're allowed to use per-instance seeding.)
- `_swiftEmpty{Array,Dictionary,Set}Storage` should be marked with `SWIFT_RUNTIME_STDLIB_INTERFACE` so that they can be linked from the standard library implementation.
- Runtime export symbols ought to have protected visibility.
Adjust the signature to match the ICU declaration for
`unorm2_normalize`. This was adjusted to allow building against ICU
59.1. The shim type definition for the UChar ensures that the signature
is correct on all the targets. NFC.
Restore (un-revert) sting comparison, with fixes
More exhaustive testing of opaque strings, which consistently reproduces prior sporadic failure. Shims fixups. Some test tweaking.
The default ICU build will change the underlying type of the UChar type,
with C++ using the builtin `char16_t` rather than `unsigned short`.
This adjusts the interface to account for that. I've verified across
Apple's implementation that they always use the `unsigned short` as the
type for `UChar`. Since we cannot guarantee that the ICU interfaces are
built the same way on all targets, especially when using the underlying
system's ICU.
Adjust the stubs implementation declaration to match the ICU header's
declaration.
On `istringstream`, `tellg()` returns -1 if the stream is at the end of the file. This indicates success in this circumstance, so we should update `pos` to reflect that the whole string has been read.
NFC on platforms other than Windows, Cygwin, and Haiku.
* [runtime] Clean up symbols in error machinery.
* [runtime] Clean up symbols in Foundation overlay.
* [runtime] Clean up symbols in collections and hashing.
* [runtime] Remove symbol controls from the Linux definition of swift_allocError.
* [tests] Add more stub functions for tests that link directly to the runtime.
This adds the swift include path manually to the builds for the stubs
and the runtime. This has no impact for the build currently. However,
adding the additional include directory will enable a standalone build
for the stdlib.
String's hashValue function is implemented in terms of Foundation's hash
function in a runtime function on darwin platforms. For non-ASCII strings we
will call str.decomposedStringWithCanonicalMapping inside this runtime function
which will allocate a new NSString and return the result in the current
autorelease pool. We implemented this function in a file compiled without ARC.
This meant that we would leak said NSString into the current active autorelease
pool.
This patch moves the implementation to a file compiled with ARC. ARC will insert
objc_retainAutoreleasedReturnValue call and on platforms that require it an
marker for the hand-off of the autoreleased return value optimization.
SR-4889
rdar://32199117
Windows x86 requires that the TLS destructor callback uses the "stdcall"
calling convention. Provide a shim which will adjust the calling
convention and call back into the swift portion of the code code with
the expected calling convention.
Force the autolinking on Windows and Darwin as both have mechanisms to
support this. ELFish targets are unfortunately not supported yet as
there is no portable mechanism to do this.
Remove the unnecessary handling of specific targets. Always perform the
cast as it adds no overhead and will always be correct (worst case is
that the type is cast to itself). This simplifies the logic.
Move the forward declarations to avoid inclusion to the same location as
the inclusion.
Rename the explicit `pthread` to `thread` to indicate that this is not
`pthread` specifically. This allows us to implement the TLS support for
Windows using Fibers.