This is the mail archive of the java@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]

Creating a C/C++ library using Java


Hi,

has anybody thought about creating a C/C++ library using Java and gcj?

I haven't looked into the internals closely yet, but it seems to me that at
least the garbage collector would make it difficult (right?).  I am not
sure whether there would be actual conflicts, or whether the library would
just behave in an unexpected way (e.g., seem to initiallly leak memory).
Replacing the GC with a reference-counting (pseudo-)GC for that seems difficult
since object references are mapped to C++ pointers and some kind of wrapping
to count the references up and down would be necessary.  Also, I imagine the
JVM initialization (System.* object(s), threading package, etc.) might cause
conflicts with the application linking with the (so created) library.

Any thoughts on how to make this possible, or why it would be difficult?

.. Juan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]