< prev index next >
src/share/vm/prims/jvmtiEnvBase.cpp
Print this page
*** 1488,1505 ****
_owned_monitors_list->append(jmsdi);
}
}
}
! GrowableArray<jobject>* JvmtiModuleClosure::_tbl = NULL;
jvmtiError
JvmtiModuleClosure::get_all_modules(JvmtiEnv* env, jint* module_count_ptr, jobject** modules_ptr) {
ResourceMark rm;
MutexLocker ml(Module_lock);
! _tbl = new GrowableArray<jobject>(77);
if (_tbl == NULL) {
return JVMTI_ERROR_OUT_OF_MEMORY;
}
// Iterate over all the modules loaded to the system.
--- 1488,1505 ----
_owned_monitors_list->append(jmsdi);
}
}
}
! GrowableArray<OopHandle>* JvmtiModuleClosure::_tbl = NULL;
jvmtiError
JvmtiModuleClosure::get_all_modules(JvmtiEnv* env, jint* module_count_ptr, jobject** modules_ptr) {
ResourceMark rm;
MutexLocker ml(Module_lock);
! _tbl = new GrowableArray<OopHandle>(77);
if (_tbl == NULL) {
return JVMTI_ERROR_OUT_OF_MEMORY;
}
// Iterate over all the modules loaded to the system.
*** 1511,1521 ****
jobject* array = (jobject*)env->jvmtiMalloc((jlong)(len * sizeof(jobject)));
if (array == NULL) {
return JVMTI_ERROR_OUT_OF_MEMORY;
}
for (jint idx = 0; idx < len; idx++) {
! array[idx] = _tbl->at(idx);
}
_tbl = NULL;
*modules_ptr = array;
*module_count_ptr = len;
return JVMTI_ERROR_NONE;
--- 1511,1521 ----
jobject* array = (jobject*)env->jvmtiMalloc((jlong)(len * sizeof(jobject)));
if (array == NULL) {
return JVMTI_ERROR_OUT_OF_MEMORY;
}
for (jint idx = 0; idx < len; idx++) {
! array[idx] = JNIHandles::make_local(Thread::current(), _tbl->at(idx).resolve());
}
_tbl = NULL;
*modules_ptr = array;
*module_count_ptr = len;
return JVMTI_ERROR_NONE;
< prev index next >