This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: win32: Why exports of JNI_* symbols from _exe_ files
- From: Danny Smith <danny_r_smith_2001 at yahoo dot co dot nz>
- To: Ranjit Mathew <rmathew at hotmail dot com>
- Cc: java at gcc dot gnu dot org
- Date: Tue, 5 Aug 2003 20:33:58 +1000 (EST)
- Subject: Re: win32: Why exports of JNI_* symbols from _exe_ files
--- Ranjit Mathew <rmathew@hotmail.com> wrote: > Danny Smith wrote:
> > Removing __declspec(dllimport) from the declaration of foo in main.c fixes.
> > Also, even if foo() does live in dll and has the __imp__ prefix, the
> > dllimport attribute is not necessary and the fixup will occur in the dll.
>
> Yes, but isn't there a performance penalty to this?
One thunk from foo to __imp__foo in the dll. How often
are these functions called? If they were calls to some
math function in the inner loop of extensive matrix math, I
might be concerned. There is also a penalty for using the
attribute: the address of *_imp__foo is not a constant, so can't
be used in file scope initializers
>
>
http://msdn.microsoft.com/library/en-us/vccore98/HTML/_core_using___declspec.28.dllimport.29_.and___declspec.28.dllexport.29.asp
>
> (or http://tinyurl.com/j0r0 if the above URL is mauled)
>
>
> > I'm wondering if the JNIEXP attribute should also be removed from the definitions
> > in jni.cc. If you want to specify what goes into a .dll, can always use a .DEF file
> > when building the dll (or .exe for that matter).
>
> Yeah, but that's cumbersome... Or maybe not - since this
> DEF file has to be created only once - it's not like
> new JNI methods are being added every now and then.
>
That's what I thought. Only three methods are actually marked as dllexport
in code now.
Danny
> ~shrug~
>
> Ranjit.
>
http://personals.yahoo.com.au - Yahoo! Personals
- New people, new possibilities! Try Yahoo! Personals, FREE for a limited period!