caching tpa list for optimization 42/184942/1
authorWoongsuk Cho <ws77.cho@samsung.com>
Tue, 24 Jul 2018 11:07:47 +0000 (20:07 +0900)
committerWoongsuk Cho <ws77.cho@samsung.com>
Tue, 24 Jul 2018 11:07:47 +0000 (20:07 +0900)
Change-Id: I7853ff5979afbfdd88bb55910ddd89087ebec1ba

NativeLauncher/installer-plugin/ni_common.cc

index 8c200ce..f9e81b8 100644 (file)
@@ -58,6 +58,7 @@ static const char* __CROSSGEN_PATH = __STR(CROSSGEN_PATH);
 #undef __XSTR
 
 static int __interval = 0;
+static std::string __tpa;
 
 static void waitInterval()
 {
@@ -138,12 +139,11 @@ static void crossgen(const std::string& dllPath, const std::string& appPath, boo
                        return;
                }
        } else {
-               std::string tpa = getTPA();
                std::string jitPath = getRuntimeDir() + "/libclrjit.so";
                std::vector<const char*> argv = {
                        __CROSSGEN_PATH,
                        "/nologo",
-                       "/Trusted_Platform_Assemblies", tpa.c_str(),
+                       "/Trusted_Platform_Assemblies", __tpa.c_str(),
                        "/JITPath", jitPath.c_str()
                };
 
@@ -272,6 +272,8 @@ int initNICommon(NiCommonOption* option)
                return -1;
        }
 
+       __tpa = getTPA();
+
        return 0;
 }
 
@@ -281,6 +283,8 @@ void finalizeNICommon()
 
        finalizePluginManager();
        finalizePathManager();
+
+       __tpa.clear();
 }