It might make sense to consider it equivalent to GC.Collect() and trigger a S1215.
Repro steps
GC.Collect(); // S1215: Refactor the code to remove this use of 'GC.Collect'.
GC.GetTotalMemory(true); // No warning.
Expected behavior
GC.Collect(); // S1215: Refactor the code to remove this use of 'GC.Collect'.
GC.GetTotalMemory(true); // S1215: Refactor the code to remove this use of 'GC.GetTotalMemory', or do not set 'forceFullCollection' to true.
Description
GC.GetTotalMemory(forceFullCollection: true)
callsGC.Collect()
internally.It might make sense to consider it equivalent to
GC.Collect()
and trigger a S1215.Repro steps
Expected behavior
Actual behavior
No warning.
Known workarounds
None.
Related information