Commit Graph

5783 Commits

Author SHA1 Message Date
Valeriy Van
7d8c75489d Fixes example snippet in Reverse.swift 2020-05-02 13:45:56 +02:00
Valeriy Van
75f30676b9 Fixes example snippet in Result.swift 2020-05-02 13:30:49 +02:00
Valeriy Van
9eab9f3913 Fixes example snippets in MutableCollection.swift 2020-05-02 06:15:37 +02:00
swift-ci
fa69a341ae Merge pull request #31487 from amartini51/master 2020-05-01 19:10:19 -07:00
swift-ci
68e01035f7 Merge pull request #31471 from valeriyvan/FixExampleSnippetKeyValuePairs.swift 2020-05-01 18:22:09 -07:00
swift-ci
82e04f8f48 Merge pull request #31480 from valeriyvan/FixExampleSnippetMemoryLayout.swift 2020-05-01 17:26:41 -07:00
Valeriy Van
55006887d1 Fixes example snippet in ExistentialCollection.swift (#31462)
* Fixes example snippet in ExistentialCollection.swift

* Removes extra parentheses
2020-05-01 16:40:39 -07:00
Alex Martini
89464353ac Remove stray backtick in docs.
Fixes <rdar://problem/62747693>
2020-05-01 16:01:15 -07:00
Valeriy Van
e34ee7b61c Fixes example snippet in MemoryLayout.swift 2020-05-01 22:52:34 +02:00
Nate Cook
2938466ecb Update docs for numericCast (#31464)
Drops outdated random number generation example and simplifies a bit.

Fixes <rdar://problem/57888487>
2020-05-01 15:14:33 -05:00
Valeriy Van
71f8a4eda6 Fixes example snippet in KeyValuePairs.swift 2020-05-01 21:23:44 +02:00
swift-ci
f503a2d58a Merge pull request #31450 from valeriyvan/FixExampleSnippetsDictionary.swift 2020-04-30 18:48:39 -07:00
swift-ci
74b4e43bd7 Merge pull request #31334 from valeriyvan/StringUnicodeScalarView 2020-04-30 14:46:17 -07:00
swift-ci
4bf38a1eeb Merge pull request #31448 from valeriyvan/FixDocCommentCTypes 2020-04-30 14:43:07 -07:00
Valeriy Van
589dd73d39 Fixes example snippets in Dictionary.swift 2020-04-30 22:24:08 +02:00
Valeriy Van
2d6313f919 Adds doc comment to internal func _memcpy in CTypes.swift 2020-04-30 21:48:00 +02:00
Valeriy Van
b90f996824 Fixes doc comment of func _memmove in CTypes.swift 2020-04-30 21:45:56 +02:00
swift-ci
62e5780c78 Merge pull request #31348 from valeriyvan/StringUTF16View 2020-04-30 12:36:08 -07:00
Robert Widmann
bb9a41ef2a Merge pull request #31405 from valeriyvan/FixSnippetsCharacterProperties
Fixes example snippets in CharacterProperties.swift
2020-04-30 10:33:48 -07:00
Valeriy Van
d30661dace Fixes example snippets in CString.swift (#31407)
* Fixes example snippets in CString.swift

* Fixes example snippet in CString.swift
2020-04-29 16:43:27 -07:00
tbkka
70b3f01504 Reduce generics in Codable (#31278)
In particular, types generic on the CodingKey produce a lot of runtime metadata.
Reducing the number of such types should help with some of the reported memory
bloat from Codable.

Based on a suggestion of @jckarter

Resolves rdar://62620208
2020-04-29 15:23:26 -07:00
Valeriy Van
1ef6001bcd Fixes and unifies outputs of example snippets in CharacterProperties.swift as it was suggested in review to PR 2020-04-29 23:34:30 +02:00
Joe Groff
9cdfb0edfc Merge pull request #30560 from 3405691582/OpenBSD_StringStorage_AvoidMallocSize
[stdlib] Avoid malloc_size on OpenBSD.
2020-04-29 11:02:06 -07:00
Valeriy Van
e1e33b98a9 Fixes example snippets in CharacterProperties.swift 2020-04-29 19:11:15 +02:00
Valeriy Van
f434cbab05 Fixes example snippets in StringUTF16View.swift 2020-04-27 23:54:04 +02:00
3405691582
7830028f55 [stdlib] Avoid malloc_size on OpenBSD.
malloc introspection is a platform feature that is unavailable on
OpenBSD. There is no workaround for the feature, so we have to assume
that allocations succeed in allocating exactly the amount of memory
requested, and nothing more.

Here a new mallocSize shim is introduced so the feature check for malloc
introspection is pushed to the shims, rather than using os checks
directly from Swift. Not every use of malloc_size has been converted
yet; ManagedBuffer.swift still remains. However, this module requires
special care to fix, which will be done separately.
2020-04-27 15:52:37 -04:00
Valeriy Van
b0425a6cd8 Fixes example snippet 2020-04-26 22:08:27 +02:00
swift-ci
d7b5de95f3 Merge pull request #31321 from valeriyvan/SnippetsUnsafePointer 2020-04-25 19:02:45 -07:00
Valeriy Van
ad1c957b8d Fixes example snippets in UnsafePointer.swift 2020-04-25 22:51:37 +02:00
Valeriy Van
5e3dd58e14 Fixes snippets in UnsafeRawPointer.swift 2020-04-25 21:04:15 +02:00
Michael Ilseman
249d2eeb2c [string] Add _deconstructUTF8 for internal usage
Add string deconstruction into contiguous UTF-8 (allocating if
needed).

Comments and docs to come soon, for now doing early testing.
2020-04-24 12:13:41 -07:00
David Smith
a4d3261669 Merge pull request #31110 from Catfish-Man/tagged-too-two
Avoid losing the high bits of bridged constant tagged pointers
2020-04-23 12:07:22 -07:00
Valeriy Van
b6e46677e7 Fixes doc comment in UnsafeRawBufferPointer.swift.gyb 2020-04-23 18:45:00 +02:00
David Smith
220f0ccde8 Untag tagged constant NSString pointers before we wrap them, so BridgeObject doesn't stomp the high bits 2020-04-22 16:49:23 -07:00
Robert Widmann
177bd245b2 Merge pull request #30702 from benrimmington/static-string-extensions
[stdlib] StaticString: extension per conformance
2020-04-20 09:58:06 -07:00
Valeriy Van
2dcbc53949 Removes redundant buffer zeroing in foreignErrorCorrectedGrapheme func 2020-04-17 22:51:28 +02:00
Hamish Knight
f2564d5126 [stdlib] Add a couple of missing @_nonEphemeral attributes 2020-04-16 10:17:16 -07:00
David Smith
e192a7ec0f Merge pull request #30966 from Catfish-Man/tagged-too
Avoid attempting to create SmallStrings for constant tagged CFStrings
2020-04-15 15:37:10 -07:00
David Smith
5ad4b15af6 Avoid attempting to create SmallStrings for constant tagged CFStrings 2020-04-15 12:30:20 -07:00
Saleem Abdulrasool
d0048ccc61 stdlib: android does not support FP80
Correct the maximal floating point width.  Although technically, Android
could support FP128 on AArch64, Swift does not currently support FP128.
For now, ensure that we use FP64 on Android.
2020-04-13 12:23:26 -07:00
Robert Widmann
763875aea7 Merge pull request #15108 from darquro/fast-path-ad-hoc-printing-of-strings
[stdlib][SR-7136] Fast-path ad-hoc printing of Strings
2020-04-12 09:30:52 -07:00
Saleem Abdulrasool
b7654f158b Merge pull request #30885 from compnerd/android-fp80
stdlib: android does not support fp80
2020-04-11 10:13:52 -07:00
Michael Ilseman
38fce16254 [string] Convert IR tests to SIL tests 2020-04-10 11:39:22 -07:00
Michael Ilseman
d02f5bc509 [string] Move wCSIA check higher than _HasContiguousBytes 2020-04-10 11:39:03 -07:00
Michael Ilseman
ae224cacdb [string] Restore _HasContiguousBytes for untyped storage
UnsafeRawBufferPointer cannot implement
withContiguousStorageIfAvailable because doing so would potentially
create a typed pointer from untyped data.
2020-04-09 13:38:28 -07:00
Michael Ilseman
e536ad2342 [string] Outline cold path from initializer
Outline the cold, non-contiguous UTF-8 path from String(decoding:as:),
saving ~40 bytes (33%) of code size (x86_64 and arm64) from every call
site where the contiguity check cannot be constant folded away.
2020-04-09 13:38:28 -07:00
Michael Ilseman
c2631004d7 [string] _HasContiguousBytes -> withContiguousStorageIfAvailable
Switch String(decoding:as) and other entry points to call
withContiguousStorageIfAvailable rather than use _HasContiguousBytes.
2020-04-09 13:38:28 -07:00
Michael Ilseman
19b332c8e2 [gardening] Delete Trailing Whitespace 2020-04-09 13:38:27 -07:00
Saleem Abdulrasool
3fe5b1531c stdlib: android does not support fp80
Like Windows, Android does not support FP80.  Ensure that we do not emit
these even on x86 and x86_64.
2020-04-08 10:07:50 -07:00
Dario Rexin
999b93bfdb Merge pull request #30815 from ktoso/wip-mangledTypeName
Improve usability of _mangledTypeName with Any.Type arguments
2020-04-06 20:49:13 -07:00