@@ -18,7 +18,7 @@ struct _StringBufferIVars {
18
18
}
19
19
20
20
init (
21
- usedEnd: UnsafeMutablePointer < RawByte > ,
21
+ usedEnd: UnsafeMutablePointer < _RawByte > ,
22
22
byteCapacity: Int ,
23
23
elementWidth: Int
24
24
) {
@@ -30,7 +30,7 @@ struct _StringBufferIVars {
30
30
31
31
// This stored property should be stored at offset zero. We perform atomic
32
32
// operations on it using _HeapBuffer's pointer.
33
- var usedEnd : UnsafeMutablePointer < RawByte >
33
+ var usedEnd : UnsafeMutablePointer < _RawByte >
34
34
35
35
var capacityAndElementShift : Int
36
36
var byteCapacity : Int {
@@ -127,12 +127,13 @@ public struct _StringBuffer {
127
127
}
128
128
129
129
/// A pointer to the start of this buffer's data area.
130
- public var start : UnsafeMutablePointer < RawByte > {
130
+ public // @testable
131
+ var start : UnsafeMutablePointer < _RawByte > {
131
132
return UnsafeMutablePointer ( _storage. baseAddress)
132
133
}
133
134
134
135
/// A past-the-end pointer for this buffer's stored data.
135
- var usedEnd : UnsafeMutablePointer < RawByte > {
136
+ var usedEnd : UnsafeMutablePointer < _RawByte > {
136
137
get {
137
138
return _storage. value. usedEnd
138
139
}
@@ -146,7 +147,7 @@ public struct _StringBuffer {
146
147
}
147
148
148
149
/// A past-the-end pointer for this buffer's available storage.
149
- var capacityEnd : UnsafeMutablePointer < RawByte > {
150
+ var capacityEnd : UnsafeMutablePointer < _RawByte > {
150
151
return start + _storage. value. byteCapacity
151
152
}
152
153
@@ -172,7 +173,7 @@ public struct _StringBuffer {
172
173
// "grow()," below.
173
174
@warn_unused_result
174
175
func hasCapacity(
175
- cap: Int , forSubRange r: Range < UnsafePointer < RawByte > >
176
+ cap: Int , forSubRange r: Range < UnsafePointer < _RawByte > >
176
177
) -> Bool {
177
178
// The substring to be grown could be pointing in the middle of this
178
179
// _StringBuffer.
@@ -191,7 +192,7 @@ public struct _StringBuffer {
191
192
/// to extend.
192
193
/// - parameter newUsedCount: The desired size of the substring.
193
194
mutating func grow(
194
- bounds: Range < UnsafePointer < RawByte > > , newUsedCount: Int
195
+ bounds: Range < UnsafePointer < _RawByte > > , newUsedCount: Int
195
196
) -> Bool {
196
197
var newUsedCount = newUsedCount
197
198
// The substring to be grown could be pointing in the middle of this
@@ -220,8 +221,8 @@ public struct _StringBuffer {
220
221
// return true
221
222
// }
222
223
let usedEndPhysicalPtr =
223
- UnsafeMutablePointer < UnsafeMutablePointer < RawByte > > ( _storage. _value)
224
- var expected = UnsafeMutablePointer < RawByte > ( bounds. endIndex)
224
+ UnsafeMutablePointer < UnsafeMutablePointer < _RawByte > > ( _storage. _value)
225
+ var expected = UnsafeMutablePointer < _RawByte > ( bounds. endIndex)
225
226
if _stdlib_atomicCompareExchangeStrongPtr (
226
227
object: usedEndPhysicalPtr, expected: & expected, desired: newUsedEnd) {
227
228
return true
0 commit comments