Hi Raif,

The synchronization is still not completely right. If a method operates
on two different BigIntegers, they both need to be protected from
asynchronous finalization. Note also that when you synchronize on two
different objects, you need to protect against deadlock.

Also, could you please change USING_NATIVE into a final constant, so
that VMs that set WANT_NATIVE_BIG_INTEGER  to false don't get all that
extra code? You can do that and still keep the fallback approach (if the
native library is missing), by using the following pattern:

private static final boolean USING_NATIVE =
Configuration.WANT_NATIVE_BIG_INTEGER && initNative();

private static boolean initNative()
{
  // .. load library
  return success;
}

Regards,
Jeroen

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Raif S. Naffah
> Sent: Sunday, October 08, 2006 11:34
> To: classpath-patches@gnu.org
> Subject: [cp-patches] RFC: PR Classpath/28664 - GNU MP based 
> BigIntegertake2 (compressed)
> 
> hello all,
> 
> the attached proposed patch addresses the above and 
> incorporates Jeroen 
> Frijters pattern for native implementation using native memory.
> 
> the related ChangeLog entry will look like so:
> 
> 2006-10-08  Raif S. Naffah  <[EMAIL PROTECTED]>
> 
>       PR Classpath/28664
>       * INSTALL: Added documentation about GNU MP.
>       * configure.ac: Add support for configuring GNU MP.
>       * native/jni/Makefile.am: Include java-math directory 
> if required.
>       * native/jni/java_math/.cvsignore: New file.
>       * native/jni/java_math/Makefile.am: Likewise.
>       * native/jni/java_math/java_math_BigInteger.c: Likewise.
>       * native/jni/java_math: New folder.
>       * include/java_math_BigInteger.h: New file.
>       * java/math/BigInteger.java: Added support for native methods.
>       * gnu/classpath/Configuration.java.in 
> (WANT_NATIVE_BIG_INTEGER): New field.
> 
> ok to commit?
> 
> cheers;
> rsn
> 

Reply via email to