File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 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(
155155 BridgedASTContext astContext,
156156 void *_Nonnull sourceFile,
157157 BridgedIfConfigClauseRangeInfo *_Nullable *_Nonnull);
158+ void swift_ASTGen_freeConfiguredRegions (
159+ BridgedIfConfigClauseRangeInfo *_Nullable regions, intptr_t numRegions);
158160
159161#ifdef __cplusplus
160162}
Original file line number Diff line number Diff line change @@ -275,3 +275,11 @@ extension SyntaxProtocol {
275275 return false
276276 }
277277}
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 {
31343134 IfConfigClauseRanges.Ranges .reserve (numRegions);
31353135 for (intptr_t i = 0 ; i != numRegions; ++i)
31363136 IfConfigClauseRanges.Ranges .push_back (regions[i].unbridged ());
3137- free (regions);
3137+ swift_ASTGen_freeConfiguredRegions (regions, numRegions );
31383138
31393139 IfConfigClauseRanges.IsSorted = true ;
31403140 }
You can’t perform that action at this time.
0 commit comments