Refine ContextManager
- Add isManagingContext API
- Remove global lock and global variable (use Singleton instead)
- Encapsulate getSlotIndexFromAddress API
- Extract configurable define to Config.h
diff --git a/lib/bcc/Script.cpp b/lib/bcc/Script.cpp
index e8dd4a3..34fe4f5 100644
--- a/lib/bcc/Script.cpp
+++ b/lib/bcc/Script.cpp
@@ -300,10 +300,9 @@
// Note: If the address of the context is not in the context slot, then
// we don't have to cache it.
- char *addr = getContext();
-
if (mCachePath &&
- !mIsContextSlotNotAvail && getSlotIndexFromAddress(addr) >= 0 &&
+ !mIsContextSlotNotAvail &&
+ ContextManager::get().isManagingContext(getContext()) &&
!getBooleanProp("debug.bcc.nocache")) {
FileHandle file;