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]

Re: Calling a Java function from C++ using CNI


>>>>> "Shaun" == Shaun Jackman <sjackman@telus.net> writes:

Shaun> What does JvCreateJavaVM accomplish?

It initializes the GC, the thread system, signals; sets up some global
constants (like primitive classes); and a few other miscellaneous
things.

Shaun> Could it be called lazily, simply
Shaun> called the first time a Java object is created or a Java static
Shaun> function is called?

I don't think so, as that would mean adding overhead all over.
Perhaps we could make the startup sequence shorter though.

BTW, in your example, you probably want to initialize the class
before calling a static method on it.  In gcj, the caller must ensure
the class is initialized, and CNI doesn't do this checking -- you
must do it manually (this bites me from time to time :-)

Tom


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