mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user