Skip to content

Commit

Permalink
Add parameter to control warning about memory constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
kennknowles committed Jun 15, 2022
1 parent 3ecf016 commit 67cb4d2
Showing 1 changed file with 11 additions and 1 deletion.
Expand Up @@ -295,6 +295,11 @@
// org.checkerframework.framework.source.SourceChecker.logBugInCF
"noPrintErrorStack",

// Whether to NOT issue a warning when performance is impeded by
// memory constraints. An INFO level message with be printed, to
// interoperate better with -Werror
"noWarnMemoryConstraints",

// Only output error code, useful for testing framework
// org.checkerframework.framework.source.SourceChecker.message(Kind, Object, String, Object...)
"nomsgtext",
Expand Down Expand Up @@ -938,8 +943,13 @@ public void typeProcess(TypeElement e, TreePath p) {

if (!warnedAboutGarbageCollection) {
String gcUsageMessage = SystemPlume.gcUsageMessage(.25, 60);
boolean noWarnMemoryConstraints =
(processingEnv != null
&& processingEnv.getOptions() != null
&& processingEnv.getOptions().containsKey("noWarnMemoryConstraints"));
if (gcUsageMessage != null) {
messager.printMessage(Kind.WARNING, gcUsageMessage);
Kind kind = noWarnMemoryConstraints ? Kind.INFO : Kind.WARNING
messager.printMessage(kind, gcUsageMessage);
warnedAboutGarbageCollection = true;
}
}
Expand Down

0 comments on commit 67cb4d2

Please sign in to comment.