Pull out clearing CppCompileAction.additionalInputs to a separate function.
This way, the Spawn runner has the option of clearing this field early so that
garbage can be collected more eagerly.
RELNOTES: None.
@@ -333,6 +333,11 @@ public class CppCompileAction extends AbstractAction
return Preconditions.checkNotNull(additionalInputs);
}
+ /** Clears the discovered {@link #additionalInputs}. */
+ public void clearAdditionalInputs() {
+ additionalInputs = null;
+ }
+
@Override
public boolean discoversInputs() {
return shouldScanIncludes || needsDotdInputPruning;
@@ -1100,7 +1105,7 @@ public class CppCompileAction extends AbstractAction
actionExecutionContext.getVerboseFailures(),
this);
} finally {
- additionalInputs = null;
+ clearAdditionalInputs();
}
ensureCoverageNotesFilesExist(actionExecutionContext);
