@@ -119,32 +119,35 @@ extension SwiftReflectionContextRef {
119
119
return words [ 2 ]
120
120
}
121
121
122
- internal func iterateConformanceCache( _ body: ConformanceIterationCallback ) throws {
122
+ internal func iterateConformanceCache( _ body: @escaping ConformanceIterationCallback ) throws {
123
123
var body = body
124
- if let error = swift_reflection_iterateConformanceCache ( self , {
125
- let callback = $2!. bindMemory ( to: ConformanceIterationCallback . self, capacity: 1 )
126
- callback. pointee ( $0, $1)
127
- } , & body) {
124
+ if let error = withUnsafeMutablePointer ( to: & body, {
125
+ swift_reflection_iterateConformanceCache ( self , {
126
+ $2!. bindMemory ( to: ConformanceIterationCallback . self, capacity: 1 ) . pointee ( $0, $1)
127
+ } , $0)
128
+ } ) {
128
129
throw Error ( cString: error)
129
130
}
130
131
}
131
132
132
- internal func iterateMetadataAllocations( _ body: MetadataAllocationIterationCallback ) throws {
133
+ internal func iterateMetadataAllocations( _ body: @escaping MetadataAllocationIterationCallback ) throws {
133
134
var body = body
134
- if let error = swift_reflection_iterateMetadataAllocations ( self , {
135
- let callback = $1!. bindMemory ( to: MetadataAllocationIterationCallback . self, capacity: 1 )
136
- callback. pointee ( $0)
137
- } , & body) {
135
+ if let error = withUnsafeMutablePointer ( to: & body, {
136
+ swift_reflection_iterateMetadataAllocations ( self , {
137
+ $1!. bindMemory ( to: MetadataAllocationIterationCallback . self, capacity: 1 ) . pointee ( $0)
138
+ } , $0)
139
+ } ) {
138
140
throw Error ( cString: error)
139
141
}
140
142
}
141
143
142
- internal func iterateMetadataAllocationBacktraces( _ body: MetadataAllocationBacktraceIterationCallback ) throws {
144
+ internal func iterateMetadataAllocationBacktraces( _ body: @escaping MetadataAllocationBacktraceIterationCallback ) throws {
143
145
var body = body
144
- if let error = swift_reflection_iterateMetadataAllocationBacktraces ( self , {
145
- let callback = $3!. bindMemory ( to: MetadataAllocationBacktraceIterationCallback . self, capacity: 1 )
146
- callback. pointee ( $0, $1, $2!)
147
- } , & body) {
146
+ if let error = withUnsafeMutablePointer ( to: & body, {
147
+ swift_reflection_iterateMetadataAllocationBacktraces ( self , {
148
+ $3!. bindMemory ( to: MetadataAllocationBacktraceIterationCallback . self, capacity: 1 ) . pointee ( $0, $1, $2!)
149
+ } , $0)
150
+ } ) {
148
151
throw Error ( cString: error)
149
152
}
150
153
}
0 commit comments