I am trying to get the following pattern to work with @_noLocks
:
@_noLocks
func test(execute: () -> Void) {
execute()
}
This works:
test { 1 + 1 }
But this doesn't work:
test {
_unsafePerformance { _ = 1 + 1 } ❌ Generic function calls can cause metadata allocation or locks
}
This is only happening if _unsafePerformance
is called from a closure that I pass in and not directly from test
.