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

Commit 884a2638 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...

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

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2797732



Change-Id: I01185144f0abce0db2c3a9ff74598847a3ec80a4
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 84fa448f d08dd93b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2018,9 +2018,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.