Michael, Jusa,
thanks for the hints. I'll try it for the JNI-to-CNI transition. With CNI it
may be possble to get rid of some blobs and simply use shared libs e.g. to
use the libgmp3c2.so from the standard "apt-get install".
The GNU compiler seems to optimize some code away - to some extent. Other
things may need direct patches - e.g. there's a dependcy on ant.jar during
link which I belive is superflous.
// Sven-Ola
Am Mittwoch 12 M?rz 2008 16:52:44 schrieb Jusa Saari:
> On Wed, 12 Mar 2008 09:30:30 +0000, Michael Rogers wrote:
> > On Mar 11 2008, Sven-Ola T?cke wrote:
> >> P.S. While I'm not a Java expert - for unbloating software, normally an
> >> #ifdef is a good thing [tm]. Any analog contructs with this funny
> >> language?
> >
> > Dynamically loaded classes can be useful when you want to switch between
> > implementations. If you want to enable/disable code you can use final
> > variables (equivalent of consts in C) - the compiler (at least the Sun
> > compiler) will optimise away unreachable parts of the code. The following
> > code produces different bytecode depending on the flag, with only one of
> > the strings included in the bytecode. But if you remove the 'final'
> > modifier, both strings are included.
> >
> > class IfDefTest
> > {
> > final static boolean FLAG = true;
> >
> > public static void main (String[] args) {
> > if (FLAG) System.out.println ("The flag is true"); else
> > System.out.println ("The flag is false");
> > }
> > }
> > }
> > Cheers,
> > Michael
>
> Better make the flag priavte too ("private final static boolean"),
> that way it won't be visible from any other class and can thus be
> optimized away completely. Dunno if the Sun compiler is smart enough to do
> so, thought.
>
> _______________________________________________
> Devl mailing list
> Devl at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl