Add BCC support for rs_object_slots metadata.
This is added to support proper cleanup of RS resources. We were leaking some
global resources because there was no way to tell which slots to clear.
Change-Id: I3e01ff4f7105444b7610d514f10dd56cb1b359b8
b: 3381615
diff --git a/lib/bcc/bcc.cpp b/lib/bcc/bcc.cpp
index 294842b..11e3a95 100644
--- a/lib/bcc/bcc.cpp
+++ b/lib/bcc/bcc.cpp
@@ -242,3 +242,33 @@
unwrap(script)->getFuncInfoList(funcInfoListSize, funcInfoList);
}
}
+
+
+extern "C" size_t bccGetObjectSlotCount(BCCScriptRef script) {
+ BCC_FUNC_LOGGER();
+ return unwrap(script)->getObjectSlotCount();
+}
+
+
+extern "C" void bccGetObjectSlotList(BCCScriptRef script,
+ size_t objectSlotListSize,
+ uint32_t *objectSlotList) {
+ BCC_FUNC_LOGGER();
+
+ if (objectSlotList) {
+ unwrap(script)->getObjectSlotList(objectSlotListSize, objectSlotList);
+#if USE_DISASSEMBLER_FILE
+ size_t count = unwrap(script)->getObjectSlotCount();
+ LOGD("ObjectSlotCount = %lu\n", (unsigned long)count);
+
+ if (count > objectSlotListSize) {
+ count = objectSlotListSize;
+ }
+
+ for (size_t i = 0; i < count; ++i) {
+ LOGD("ObjectSlotList[%lu] = %d\n", (unsigned long)i, objectSlotList[i]);
+ }
+#endif
+ }
+}
+