Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24ab6a5b authored by Miguel Aranda's avatar Miguel Aranda Committed by Automerger Merge Worker
Browse files

Merge "Allow explicit GC usage for StrictMode setClassInstanceLimit" into main am: 0d122c42

parents 435db58a 0d122c42
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -2023,9 +2023,13 @@ public final class StrictMode {
            return;
            return;
        }
        }


        // Temporarily disable checks so that explicit GC is allowed.
        final int oldMask = getThreadPolicyMask();
        setThreadPolicyMask(0);
        System.gc();
        System.gc();
        System.runFinalization();
        System.runFinalization();
        System.gc();
        System.gc();
        setThreadPolicyMask(oldMask);


        // Note: classInstanceLimit is immutable, so this is lock-free
        // Note: classInstanceLimit is immutable, so this is lock-free
        // Create the classes array.
        // Create the classes array.