|
Java and Arrays: msg#00112programming.swig
Hello SWIG will produce code like this, when using "arrays_java.i": /* signed char[] support */ int SWIG_JavaArrayInSchar (JNIEnv *jenv, jbyte **jarr, signed char **carr, jbyteArray input) { . . . sz = (*jenv)->GetArrayLength(jenv, input); *jarr = (*jenv)->GetByteArrayElements(jenv, input, 0); . . . for (i=0; i<sz; i++) (*carr)[i] = (signed char)(*jarr)[i]; return 1; } you can see: it does Copy with a "for" loop. This may suffer from Performance. WHY does SWIG not Use the Get<PrimitiveType>ArrayRegion functions ?? Described here: http://java.sun.com/products/jdk/1.2/docs/guide/jni/spec/functions.doc.html Regards, Franz Höpfinger (Diplomand) ************************************** _______________________________________________ Swig maillist - Swig@xxxxxxxxxxxxxxx http://mailman.cs.uchicago.edu/mailman/listinfo/swig |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: newbie: loading' example' example in python: 00112, Harry Mangalam |
|---|---|
| Next by Date: | linking problems: 00112, Good Times |
| Previous by Thread: | newbie: loading' example' example in pythoni: 00112, Harry Mangalam |
| Next by Thread: | Re: Java and Arrays: 00112, William S Fulton |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |