This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
this patch implements two JNI optimizations:
- avoidance of the malloc/free on each JNI call, when the call only uses the "bottom", non-reentrant frame (this is the majority of JNI traffic).
- a fast path which avoids clearing the frame when leaving it, if no local references have been made. most JNI functions do not make any local references.
+// Destroy the env's reusable resources. This is called from the threadWhy don't we just GC-allocate these - ie _Jv_AllocBytes() ? Then we wouldn't need _Jv_FreeJNIEnv.
+// destructor "finalize_native" in natThread.cc
+void +_Jv_FreeJNIEnv (_Jv_JNIEnv *env)
+{
+ if (env == NULL)
+ return;
+
+ if (env->bottom_locals != NULL)
+ _Jv_Free (env->bottom_locals);
+
+ _Jv_Free (env);
+}
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |