From d41a961426169c3d8e4382dd06b4c3ee236345ca Mon Sep 17 00:00:00 2001 From: Wei Wang Date: Thu, 10 Oct 2019 11:34:13 -0700 Subject: [PATCH] Change some globals to static Before: text data bss dec hex filename 1875636 128944 9624 2014204 1ebbfc libandroid_runtime.so After: text data bss dec hex filename 1875403 128920 9624 2013947 1ebafb libandroid_runtime.so Test: build Change-Id: Ie1d00b288c8411c8af012f3b9d7e3b740ddd3247 --- core/jni/android_os_Debug.cpp | 4 ++-- core/jni/android_util_AssetManager.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp index 9445319e47ecd..d62d2d967d852 100644 --- a/core/jni/android_os_Debug.cpp +++ b/core/jni/android_os_Debug.cpp @@ -139,8 +139,8 @@ static stat_field_names stat_field_names[_NUM_CORE_HEAP] = { "nativePrivateClean", "nativeSharedClean", "nativeSwappedOut", "nativeSwappedOutPss" } }; -jfieldID otherStats_field; -jfieldID hasSwappedOutPss_field; +static jfieldID otherStats_field; +static jfieldID hasSwappedOutPss_field; struct stats_t { int pss; diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp index af47cb6d218a9..c7b36d0f8fc94 100644 --- a/core/jni/android_util_AssetManager.cpp +++ b/core/jni/android_util_AssetManager.cpp @@ -108,7 +108,7 @@ static struct arraymap_offsets_t { jmethodID put; } gArrayMapOffsets; -jclass g_stringClass = nullptr; +static jclass g_stringClass = nullptr; // ----------------------------------------------------------------------------