mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-07-01 17:11:41 +00:00
![Tad](/assets/img/avatar_default.png)
1114c3c1d4cd
ac1943345e
1abb805041
2e07ab8c24
0044836677
c561811fad
7a848373ef
89646bdeb1
2a70bbac4a
d414dcaa35
b4cd877e3a
98634286bb
114c2635390c
11add34a4bc6
11a2b51906de
10527787f3c8
ffde474ad7
aa87e487c4
c906fe9722
c69c3eecd4
b2303adccc
5bb05db6f7
536b497688
24802a832b
ce6dcc2368
3d3d5c4d38
2eda592b79
1029f28b53c0
1013a992c716
9750efbf6bc
ed563b6f26
aad3c7d750
da3180f9a8
68773a29b7
283b3fa09c
f133136b65
01a01ce5f6
17c309c098
8806ec3ef1
Signed-off-by: Tad <tad@spotco.us>
54 lines
2.7 KiB
Diff
54 lines
2.7 KiB
Diff
From add34a4bc6aa69f21f012d62215b5af500bea551 Mon Sep 17 00:00:00 2001
|
|
From: Daniel Micay <danielmicay@gmail.com>
|
|
Date: Wed, 11 Sep 2019 06:47:11 -0400
|
|
Subject: [PATCH] disable ICU cache pinning for exec spawning
|
|
|
|
---
|
|
.../main/java/dalvik/system/ZygoteHooks.java | 26 +++++++++++--------
|
|
1 file changed, 15 insertions(+), 11 deletions(-)
|
|
|
|
diff --git a/dalvik/src/main/java/dalvik/system/ZygoteHooks.java b/dalvik/src/main/java/dalvik/system/ZygoteHooks.java
|
|
index de5a056143..e77cec2517 100644
|
|
--- a/dalvik/src/main/java/dalvik/system/ZygoteHooks.java
|
|
+++ b/dalvik/src/main/java/dalvik/system/ZygoteHooks.java
|
|
@@ -49,15 +49,17 @@ private ZygoteHooks() {
|
|
*/
|
|
@libcore.api.CorePlatformApi
|
|
public static void onBeginPreload(boolean fullPreload) {
|
|
- // Pin ICU data in memory from this point that would normally be held by soft references.
|
|
- // Without this, any references created immediately below or during class preloading
|
|
- // would be collected when the Zygote GC runs in gcAndFinalize().
|
|
- CacheValue.setStrength(CacheValue.Strength.STRONG);
|
|
-
|
|
- // Explicitly exercise code to cache data apps are likely to need.
|
|
- ULocale[] localesToPin = { ULocale.ROOT, ULocale.US, ULocale.getDefault() };
|
|
- for (ULocale uLocale : localesToPin) {
|
|
- new DecimalFormatSymbols(uLocale);
|
|
+ if (fullPreload) {
|
|
+ // Pin ICU data in memory from this point that would normally be held by soft references.
|
|
+ // Without this, any references created immediately below or during class preloading
|
|
+ // would be collected when the Zygote GC runs in gcAndFinalize().
|
|
+ CacheValue.setStrength(CacheValue.Strength.STRONG);
|
|
+
|
|
+ // Explicitly exercise code to cache data apps are likely to need.
|
|
+ ULocale[] localesToPin = { ULocale.ROOT, ULocale.US, ULocale.getDefault() };
|
|
+ for (ULocale uLocale : localesToPin) {
|
|
+ new DecimalFormatSymbols(uLocale);
|
|
+ }
|
|
}
|
|
|
|
// Framework's LocalLog is used during app start-up. It indirectly uses the current ICU time
|
|
@@ -72,8 +74,10 @@ public static void onBeginPreload(boolean fullPreload) {
|
|
*/
|
|
@libcore.api.CorePlatformApi
|
|
public static void onEndPreload(boolean fullPreload) {
|
|
- // All cache references created by ICU from this point will be soft.
|
|
- CacheValue.setStrength(CacheValue.Strength.SOFT);
|
|
+ if (fullPreload) {
|
|
+ // All cache references created by ICU from this point will be soft.
|
|
+ CacheValue.setStrength(CacheValue.Strength.SOFT);
|
|
+ }
|
|
|
|
// Clone standard descriptors as originals closed / rebound during zygote post fork.
|
|
FileDescriptor.in.cloneForFork();
|