Changeset 05aef9b


Ignore:
Timestamp:
Mar 18, 2017 2:38:59 PM (3 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
95b6bd3
Parents:
fda6730
Message:

Move "isSlow" detection to SystemVersion?

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/crypto/KeyGenerator.java

    rfda6730 r05aef9b  
    117117    /** @since 0.9.8 */
    118118    private static final boolean DEFAULT_USE_LONG_EXPONENT =
    119                                                    NativeBigInteger.isNative() &&
    120                                                    SystemVersion.is64Bit() &&
    121                                                    !SystemVersion.isGNU() &&
    122                                                    !SystemVersion.isApache() &&
    123                                                    !SystemVersion.isARM();
     119                                                   !SystemVersion.isSlow();
    124120
    125121    /**
  • core/java/src/net/i2p/util/SystemVersion.java

    rfda6730 r05aef9b  
    4040    private static final boolean _hasWrapper = System.getProperty("wrapper.version") != null;
    4141    private static final boolean _isLinuxService;
     42    private static final boolean _isSlow;
    4243
    4344    private static final boolean _oneDotSix;
     
    7071                          (DAEMON_USER.equals(System.getProperty("user.name")) ||
    7172                           (_isGentoo && GENTOO_USER.equals(System.getProperty("user.name"))));
     73        _isSlow = _isAndroid || _isApache || _isArm || _isGNU || getMaxMemory() < 48*1024*1024L;
    7274
    7375        int sdk = 0;
     
    155157
    156158    /**
     159     *  Our best guess on whether this is a slow architecture / OS / JVM,
     160     *  using some simple heuristics.
     161     *
     162     *  @since 0.9.30
     163     */
     164    public static boolean isSlow() {
     165        // we don't put the NBI call in the static field,
     166        // to prevent a circular initialization with NBI.
     167        return _isSlow || !NativeBigInteger.isNative();
     168    }
     169
     170    /**
    157171     *  Better than (new VersionComparator()).compare(System.getProperty("java.version"), "1.6") &gt;= 0
    158172     *  as it handles Android also, where java.version = "0".
     
    291305        System.out.println("Mac      : " + isMac());
    292306        System.out.println("OpenJDK  : " + isOpenJDK());
     307        System.out.println("Slow     : " + isSlow());
    293308        System.out.println("Windows  : " + isWindows());
    294309        System.out.println("Wrapper  : " + hasWrapper());
  • history.txt

    rfda6730 r05aef9b  
     12017-03-18 zzz
     2 * Addressbook (ticket #1966):
     3   - Build as jar, not war
     4   - Put empty war in updater
     5   - Move Servlet starter to SusiDNS
     6   - Skip war in RouterConsoleRunner
     7
    182017-03-14 zzz
    29 * Blockfile: Fix specified-destination deletion from the correct book
  • router/java/src/net/i2p/router/RouterVersion.java

    rfda6730 r05aef9b  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 6;
     21    public final static long BUILD = 7;
    2222
    2323    /** for example "-test" */
  • router/java/src/net/i2p/router/TunnelPoolSettings.java

    rfda6730 r05aef9b  
    6666    //public static final int     DEFAULT_LENGTH = SystemVersion.isAndroid() ? 2 : 3;
    6767
    68     private static final boolean isSlow = SystemVersion.isGNU() ||
    69                                           SystemVersion.isARM() ||
    70                                           SystemVersion.isApache() ||
    71                                           !NativeBigInteger.isNative();
     68    private static final boolean isSlow = SystemVersion.isSlow();
    7269
    7370    /** client only */
Note: See TracChangeset for help on using the changeset viewer.