template<typename T> inline T JNIEnvExt::AddLocalReference(ObjPtr<mirror::Object> obj) {
std::string error_msg;
jobject ref = reinterpret_cast<jobject>(locals_.Add(obj, &error_msg)); if (UNLIKELY(ref == nullptr)) { // This is really unexpected if we allow resizing LRTs...
LOG(FATAL) << error_msg;
UNREACHABLE();
}
// TODO: fix this to understand PushLocalFrame, so we can turn it on. if (false) { if (check_jni_) {
size_t entry_count = locals_.Capacity(); if (entry_count > 16) {
locals_.Dump(LOG_STREAM(WARNING) << "Warning: more than 16 JNI local references: "
<< entry_count << " (most recent was a "
<< mirror::Object::PrettyTypeOf(obj) << ")\n"); // TODO: LOG(FATAL) in a later release?
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.