Implement the short-term solution outlined in b/3304773.
Change-Id: Ia36379345ee3d8fbff04e6aa489d04e936331296
diff --git a/lib/bcc/Compiler.cpp b/lib/bcc/Compiler.cpp
index d9a7ea4..f4d388b 100644
--- a/lib/bcc/Compiler.cpp
+++ b/lib/bcc/Compiler.cpp
@@ -360,7 +360,8 @@
// Cache hit and some Script instance is still using this cache
if (Compiler::resNamesMmaped[i]) {
- resName = NULL; // Force the turn-off of caching for this resName
+ LOGE("Cache hit and some Script instance is still using this cache. Assuming only one instance.");
+ // resName = NULL; // Force the turn-off of caching for this resName
}
Compiler::resNamesMmaped[i]++;
@@ -380,6 +381,8 @@
resName = NULL;
}
+ // LOGE("mNoCache=%d, resName=%s", this->props.mNoCache, resName); sliao
+
// Assign bitcodeFileModTime to mSourceModTime, and bitcodeFileCRC32 to
// mSourceCRC32, so that the checkHeaderAndDependencies can use them.
mSourceModTime = bitcodeFileModTime;
@@ -1081,7 +1084,7 @@
if (mError.empty()) {
if (mUseCache && mCacheFd >= 0 && mCacheNew) {
genCacheFile();
- // LOGI("DONE generating cache file");
+ //LOGI("DONE generating cache file"); //sliao
flock(mCacheFd, LOCK_UN);
}
@@ -1275,7 +1278,7 @@
if (!mCodeMemMgr.get()) {
// mCodeDataAddr and mCacheMapAddr are from loadCacheFile and not
// managed by CodeMemoryManager.
-
+ //LOGE("~Compiler(): mCodeDataAddr = %x", mCodeDataAddr); sliao
if (mCodeDataAddr) {
deallocateContext(mCodeDataAddr);
}
diff --git a/lib/bcc/bcc.cpp b/lib/bcc/bcc.cpp
index 149139c..10a9439 100644
--- a/lib/bcc/bcc.cpp
+++ b/lib/bcc/bcc.cpp
@@ -42,6 +42,7 @@
}
extern "C" void bccDeleteScript(BCCscript *script) {
+ //LOGE("Script deleted"); sliao
delete script;
}