Remove more pieces of setRoot.  Add pointer to allocation lookup for scripts.

Change-Id: I2c3075d2056f02bb834bfad403dc72da991f3156
diff --git a/rsScriptC.cpp b/rsScriptC.cpp
index e9ba226..8a60d1e 100644
--- a/rsScriptC.cpp
+++ b/rsScriptC.cpp
@@ -71,6 +71,22 @@
     }
 }
 
+const Allocation *ScriptC::ptrToAllocation(const void *ptr) const
+{
+    if (!ptr) {
+        return NULL;
+    }
+    for (uint32_t ct=0; ct < mEnviroment.mFieldCount; ct++) {
+        if (!mSlots[ct].get())
+            continue;
+        if (mSlots[ct]->getPtr() == ptr) {
+            return mSlots[ct].get();
+        }
+    }
+    LOGE("ScriptC::ptrToAllocation, failed to find %p", ptr);
+    return NULL;
+}
+
 
 uint32_t ScriptC::run(Context *rsc, uint32_t launchIndex)
 {