minor NBI tweaks and comments
This commit is contained in:
@ -102,6 +102,14 @@ public class NativeBigInteger extends BigInteger {
|
|||||||
private static boolean _doLog = System.getProperty("jbigi.dontLog") == null &&
|
private static boolean _doLog = System.getProperty("jbigi.dontLog") == null &&
|
||||||
I2PAppContext.getGlobalContext().isRouterContext();
|
I2PAppContext.getGlobalContext().isRouterContext();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The following libraries are be available in jbigi.jar in all I2P versions
|
||||||
|
* originally installed as release 0.6.1.10 or later (released 2006-01-16),
|
||||||
|
* for linux, freebsd, and windows, EXCEPT:
|
||||||
|
* - k63 was removed for linux and freebsd in 0.8.7 (identical to k62)
|
||||||
|
* - athlon64 not available for freebsd
|
||||||
|
* - viac3 not available for windows
|
||||||
|
*/
|
||||||
private final static String JBIGI_OPTIMIZATION_K6 = "k6";
|
private final static String JBIGI_OPTIMIZATION_K6 = "k6";
|
||||||
private final static String JBIGI_OPTIMIZATION_K6_2 = "k62";
|
private final static String JBIGI_OPTIMIZATION_K6_2 = "k62";
|
||||||
private final static String JBIGI_OPTIMIZATION_K6_3 = "k63";
|
private final static String JBIGI_OPTIMIZATION_K6_3 = "k63";
|
||||||
@ -165,6 +173,9 @@ public class NativeBigInteger extends BigInteger {
|
|||||||
} catch (UnknownCPUException e) {
|
} catch (UnknownCPUException e) {
|
||||||
// log?
|
// log?
|
||||||
}
|
}
|
||||||
|
if (_isFreebsd)
|
||||||
|
// athlon64 not available for freebsd
|
||||||
|
return JBIGI_OPTIMIZATION_ATHLON;
|
||||||
return JBIGI_OPTIMIZATION_ATHLON64;
|
return JBIGI_OPTIMIZATION_ATHLON64;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -456,6 +467,7 @@ public class NativeBigInteger extends BigInteger {
|
|||||||
private static final boolean loadGeneric(boolean optimized) {
|
private static final boolean loadGeneric(boolean optimized) {
|
||||||
return loadGeneric(getMiddleName(optimized));
|
return loadGeneric(getMiddleName(optimized));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final boolean loadGeneric(String name) {
|
private static final boolean loadGeneric(String name) {
|
||||||
try {
|
try {
|
||||||
if(name == null)
|
if(name == null)
|
||||||
@ -491,6 +503,7 @@ public class NativeBigInteger extends BigInteger {
|
|||||||
String resourceName = getResourceName(optimized);
|
String resourceName = getResourceName(optimized);
|
||||||
return loadFromResource(resourceName);
|
return loadFromResource(resourceName);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final boolean loadFromResource(String resourceName) {
|
private static final boolean loadFromResource(String resourceName) {
|
||||||
if (resourceName == null) return false;
|
if (resourceName == null) return false;
|
||||||
//URL resource = NativeBigInteger.class.getClassLoader().getResource(resourceName);
|
//URL resource = NativeBigInteger.class.getClassLoader().getResource(resourceName);
|
||||||
@ -523,12 +536,16 @@ public class NativeBigInteger extends BigInteger {
|
|||||||
+ " was not a valid library for this platform");
|
+ " was not a valid library for this platform");
|
||||||
ule.printStackTrace();
|
ule.printStackTrace();
|
||||||
}
|
}
|
||||||
|
if (outFile != null)
|
||||||
|
outFile.delete();
|
||||||
return false;
|
return false;
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
if (_doLog) {
|
if (_doLog) {
|
||||||
System.err.println("ERROR: Problem writing out the temporary native library data");
|
System.err.println("ERROR: Problem writing out the temporary native library data");
|
||||||
ioe.printStackTrace();
|
ioe.printStackTrace();
|
||||||
}
|
}
|
||||||
|
if (outFile != null)
|
||||||
|
outFile.delete();
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
if (fos != null) {
|
if (fos != null) {
|
||||||
@ -567,6 +584,8 @@ public class NativeBigInteger extends BigInteger {
|
|||||||
else if (sCPUType.equals(JBIGI_OPTIMIZATION_VIAC32))
|
else if (sCPUType.equals(JBIGI_OPTIMIZATION_VIAC32))
|
||||||
// viac32 and pentium3 identical
|
// viac32 and pentium3 identical
|
||||||
sAppend = "-" + JBIGI_OPTIMIZATION_PENTIUM3;
|
sAppend = "-" + JBIGI_OPTIMIZATION_PENTIUM3;
|
||||||
|
//else if (sCPUType.equals(JBIGI_OPTIMIZATION_VIAC3) && _isWin)
|
||||||
|
// FIXME no viac3 available for windows, what to use instead?
|
||||||
else
|
else
|
||||||
sAppend = "-" + sCPUType;
|
sAppend = "-" + sCPUType;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
2011-05-25 zzz
|
2011-05-25 zzz
|
||||||
* CPUID: Load 64-bit libcpuid if available
|
* CPUID: Load 64-bit libcpuid if available
|
||||||
* HTTP Proxy: Address helper refactoring, address book add form
|
* HTTP Proxy: Address helper refactoring, address book add form
|
||||||
|
* JBigI:
|
||||||
|
- Start updating NativeBigInteger
|
||||||
|
- Remove k63 libs that are dup of k62; handle in NBI
|
||||||
* Naming: B32 fixes
|
* Naming: B32 fixes
|
||||||
* NetDB: Increase floodfills again
|
* NetDB: Increase floodfills again
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ public class RouterVersion {
|
|||||||
/** deprecated */
|
/** deprecated */
|
||||||
public final static String ID = "Monotone";
|
public final static String ID = "Monotone";
|
||||||
public final static String VERSION = CoreVersion.VERSION;
|
public final static String VERSION = CoreVersion.VERSION;
|
||||||
public final static long BUILD = 7;
|
public final static long BUILD = 8;
|
||||||
|
|
||||||
/** for example "-test" */
|
/** for example "-test" */
|
||||||
public final static String EXTRA = "";
|
public final static String EXTRA = "";
|
||||||
|
Reference in New Issue
Block a user