Skip to content
Snippets Groups Projects
Commit 0d122c42 authored by Miguel Aranda's avatar Miguel Aranda Committed by Gerrit Code Review
Browse files

Merge "Allow explicit GC usage for StrictMode setClassInstanceLimit" into main

parents 60c910a6 cf1bffaa
No related branches found
No related tags found
No related merge requests found
......@@ -2023,9 +2023,13 @@ public final class StrictMode {
return;
}
// Temporarily disable checks so that explicit GC is allowed.
final int oldMask = getThreadPolicyMask();
setThreadPolicyMask(0);
System.gc();
System.runFinalization();
System.gc();
setThreadPolicyMask(oldMask);
// Note: classInstanceLimit is immutable, so this is lock-free
// Create the classes array.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment