File tree 3 files changed +11
-1
lines changed
3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,8 @@ intptr_t swift_ASTGen_configuredRegions(
155
155
BridgedASTContext astContext,
156
156
void *_Nonnull sourceFile,
157
157
BridgedIfConfigClauseRangeInfo *_Nullable *_Nonnull);
158
+ void swift_ASTGen_freeConfiguredRegions (
159
+ BridgedIfConfigClauseRangeInfo *_Nullable regions, intptr_t numRegions);
158
160
159
161
#ifdef __cplusplus
160
162
}
Original file line number Diff line number Diff line change @@ -275,3 +275,11 @@ extension SyntaxProtocol {
275
275
return false
276
276
}
277
277
}
278
+
279
+ @_cdecl ( " swift_ASTGen_freeConfiguredRegions " )
280
+ public func freeConfiguredRegions(
281
+ regions: UnsafeMutablePointer < BridgedIfConfigClauseRangeInfo > ? ,
282
+ numRegions: Int
283
+ ) {
284
+ UnsafeMutableBufferPointer ( start: regions, count: numRegions) . deallocate ( )
285
+ }
Original file line number Diff line number Diff line change @@ -3134,7 +3134,7 @@ ArrayRef<IfConfigClauseRangeInfo> SourceFile::getIfConfigClauseRanges() const {
3134
3134
IfConfigClauseRanges.Ranges .reserve (numRegions);
3135
3135
for (intptr_t i = 0 ; i != numRegions; ++i)
3136
3136
IfConfigClauseRanges.Ranges .push_back (regions[i].unbridged ());
3137
- free (regions);
3137
+ swift_ASTGen_freeConfiguredRegions (regions, numRegions );
3138
3138
3139
3139
IfConfigClauseRanges.IsSorted = true ;
3140
3140
}
You can’t perform that action at this time.
0 commit comments