This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [RFA/JVMTI] Implement GetErrorName
- From: Tom Tromey <tromey at redhat dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 14 Sep 2006 11:50:53 -0600
- Subject: Re: [RFA/JVMTI] Implement GetErrorName
- References: <45070D84.5040304@redhat.com>
- Reply-to: tromey at redhat dot com
>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:
Keith> I've chosen to use a switch to do this because the set of JVMTI errors
Keith> in jvmtiError contains as many "holes" as there are defined errors.
FWIW I think you should make jvmti.cc changes without waiting for
approval. The only bits I'm really concerned about are things that
touch sensitive areas (performance critical or ones where other
hacking is happening) in the rest of libgcj.
Keith> Okay?
One oddity...
Keith> + jstring string = _Jv_NewStringUTF (name);
Keith> + jlong len = _Jv_GetStringUTFLength (string);
Keith> + *name_ptr = (char *) _Jv_Malloc (len + 1);
Keith> + _Jv_GetStringUTFRegion (string, 0, string->length (), *name_ptr);
Keith> + name_ptr[len] = '\0';
This is pretty roundabout. You can just use strcpy.
We already assume that the runtime charset for C string constants is
ASCII.
Tom