English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] java: short [] [] -> JNI -> int array array
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-11-28 (23:16)
From: Metalscan <contact@m...>
Subject: [Caml-list] java: short [] [] -> JNI -> int array array

I have a problem wich I couldn't solve after one long day of tests.

I've written a module to process some datas in ocaml. The program wich
will use it is in java (I do not have the choice).

Java must pass the datas to ocaml and call my functions. I turned my
module into a dynamic link library (linux ; I'll have to to this on Windowd NT).

I use Jni to call my native (Java) functions, which are registered
callbacks (ocalm) in a C function.

The transfer of "simple" datas from java to C works ok with int, float,
short []. For the latter I passed bigs arrays (about 10^6, i think).
I'll still have to give back the results to the Java world...

My problem is to pass a multidimensionnal array. When they are too big,
there is a problem during my conversion function. I suspect a misunderstanding of
the GC...

Does anybody have an example of such a creation ? I must precise that,
of course, I don't know the number of rows at compilation time, and that
the size of each of them is not garanted to be the same.

Thanks in advance for your time and any suggestion

Matthieu Dubuget
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners