Skip to content

Commit c0960d3

Browse files
authored
Merge pull request #30798 from milseman/custom_bench_collection
[benchmark] Disable inlining of wCSIA in benchmark
2 parents 688bd94 + 83e5cb5 commit c0960d3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

benchmark/single-source/UTF8Decode.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ struct CustomContiguousCollection: Collection {
198198
var endIndex: Index { storage.count }
199199
func index(after i: Index) -> Index { i+1 }
200200

201+
@inline(never)
201202
func withContiguousStorageIfAvailable<R>(
202203
_ body: (UnsafeBufferPointer<UInt8>) throws -> R
203204
) rethrows -> R? {
@@ -214,6 +215,13 @@ struct CustomNoncontiguousCollection: Collection {
214215
var startIndex: Index { 0 }
215216
var endIndex: Index { storage.count }
216217
func index(after i: Index) -> Index { i+1 }
218+
219+
@inline(never)
220+
func withContiguousStorageIfAvailable<R>(
221+
_ body: (UnsafeBufferPointer<UInt8>) throws -> R
222+
) rethrows -> R? {
223+
nil
224+
}
217225
}
218226
let allStringsCustomContiguous = CustomContiguousCollection(allStringsBytes)
219227
let asciiCustomContiguous = CustomContiguousCollection(Array(ascii.utf8))

0 commit comments

Comments
 (0)