tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native2/common jk_channel_jni.c
Date Sat, 11 May 2002 00:02:53 GMT
costin      02/05/10 17:02:53

  Modified:    jk/native2/common jk_channel_jni.c
  Log:
  Display a small warning if getArray() doesn't pin, it's an indication
  of possible performance problems.
  
  Revision  Changes    Path
  1.17      +14 -4     jakarta-tomcat-connectors/jk/native2/common/jk_channel_jni.c
  
  Index: jk_channel_jni.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_channel_jni.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- jk_channel_jni.c	10 May 2002 00:01:37 -0000	1.16
  +++ jk_channel_jni.c	11 May 2002 00:02:53 -0000	1.17
  @@ -317,7 +317,7 @@
       jbyte *nbuf;
       jbyteArray jbuf;
       int jlen;
  -    jboolean iscommit=0;
  +    jboolean iscopy=0;
       JNIEnv *jniEnv;
       jk_channel_jni_private_t *jniCh=_this->_privatePtr;
       jk_ch_jni_ep_private_t *epData=
  @@ -369,8 +369,15 @@
        *  write method. XXX We could try 'pining' if the vm supports
        *  it, this is a looong lived object.
        */
  -    nbuf = (*jniEnv)->GetByteArrayElements(jniEnv, jbuf, &iscommit);
  -
  +#ifdef JK_JNI_CRITICAL
  +    nbuf = (*jniEnv)->GetPrimitiveArrayCritical(jniEnv, jbuf, &iscopy);
  +#else
  +    nbuf = (*jniEnv)->GetByteArrayElements(jniEnv, jbuf, &iscopy);
  +#endif
  +    if( iscopy )
  +        env->l->jkLog(env, env->l, JK_LOG_INFO,
  +                      "channelJni.send() get java bytes iscopy %d\n", iscopy);
  +    
       if(nbuf==NULL ) {
           env->l->jkLog(env, env->l, JK_LOG_ERROR,
                         "channelJni.send() Can't get java bytes");
  @@ -384,8 +391,11 @@
   
       memcpy( nbuf, b, len );
   
  +#ifdef JK_JNI_CRITICAL
  +    (*jniEnv)->ReleasePrimitiveArrayCritical(jniEnv, jbuf, nbuf, 0);
  +#else
       (*jniEnv)->ReleaseByteArrayElements(jniEnv, jbuf, nbuf, 0);
  -    
  +#endif    
       if( _this->mbean->debug > 0 )
           env->l->jkLog(env, env->l, JK_LOG_INFO,
                         "channel_jni.send() before send %p\n",
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message