CNI for C

Tom Tromey
Tue Apr 13 22:08:00 GMT 2004

>>>>> "Richard" == Richard Dale <> writes:

Richard> Both java and C# use the language independent Smoke library.

Richard> All 20000+ Qt/KDE method calls in the api are funneled to a
Richard> single Invoke() call, in SmokeInvocation.cs:

Richard> So the next thing to be done is to add code to look up the
Richard> method to call in the Smoke runtime, then marshall the args
Richard> in a Object[] array into the C++ types. Then call the C++
Richard> method, and marshall the return value from C++ to C#.

This is a cool approach, but I wonder about the performance of it.
One nice part of the "GDirect" approach is that some simple C calls
will have no overhead at all, at least if we were to write a
gcj-specific GDirect.  That is, the pointer in the method table would
point directly at the C function.  (Of course whether this is an
important optimization is unknown...)


More information about the Java mailing list