/* * Visits all roots associated with a thread. */ static void visitThread(Visitor *visitor, Thread *thread, void *arg) { assert(visitor != NULL); assert(thread != NULL); (*visitor)(&thread->threadObj, arg); (*visitor)(&thread->exception, arg); visitReferenceTable(visitor, &thread->internalLocalRefTable, arg); visitReferenceTable(visitor, &thread->jniLocalRefTable, arg); if (thread->jniMonitorRefTable.table) { visitReferenceTable(visitor, &thread->jniMonitorRefTable, arg); } visitThreadStack(visitor, thread, arg); }
/* * Visits all roots associated with a thread. */ static void visitThread(RootVisitor *visitor, Thread *thread, void *arg) { u4 threadId; assert(visitor != NULL); assert(thread != NULL); threadId = thread->threadId; (*visitor)(&thread->threadObj, threadId, ROOT_THREAD_OBJECT, arg); (*visitor)(&thread->exception, threadId, ROOT_NATIVE_STACK, arg); #ifdef FASTIVA_USE_CPP_EXCEPTION (*visitor)(&thread->m_pTopHandler, threadId, ROOT_NATIVE_STACK, arg); #endif visitReferenceTable(visitor, &thread->internalLocalRefTable, threadId, ROOT_NATIVE_STACK, arg); visitIndirectRefTable(visitor, &thread->jniLocalRefTable, threadId, ROOT_JNI_LOCAL, arg); if (thread->jniMonitorRefTable.table != NULL) { visitReferenceTable(visitor, &thread->jniMonitorRefTable, threadId, ROOT_JNI_MONITOR, arg); } visitThreadStack(visitor, thread, arg); }