[String] Initial implementation of 64-bit StringGuts.

Include the initial implementation of _StringGuts, a 2-word
replacement for _LegacyStringCore. 64-bit Darwin supported, 32-bit and
Linux support in subsequent commits.
This commit is contained in:
Michael Ilseman
2018-01-21 12:32:26 -08:00
parent 75463e30f3
commit 3be2faf5d3
64 changed files with 5726 additions and 1802 deletions

View File

@@ -13,8 +13,8 @@ import Glibc
var StringTestSuite = TestSuite("String")
extension String {
var capacityInBytes: Int {
return _core.nativeBuffer!.capacity
var capacity: Int {
return _guts.capacity
}
}
@@ -51,7 +51,7 @@ func sliceConcurrentAppendThread(_ tid: ThreadID) {
sharedString = ""
sharedString.append("abc")
sharedString.reserveCapacity(16)
expectLE(16, sharedString.capacityInBytes)
expectLE(16, sharedString.capacity)
}
barrier()