< prev index next >

openjfx9/modules/javafx.graphics/src/main/java/com/sun/marlin/ArrayCacheConst.java

Print this page




   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.java2d.marlin;
  27 
  28 import java.util.Arrays;
  29 import static sun.java2d.marlin.MarlinUtils.logInfo;
  30 
  31 public final class ArrayCacheConst implements MarlinConst {
  32 
  33     static final int BUCKETS = 8;
  34     static final int MIN_ARRAY_SIZE = 4096;
  35     // maximum array size
  36     static final int MAX_ARRAY_SIZE;
  37     // threshold below to grow arrays by 4
  38     static final int THRESHOLD_SMALL_ARRAY_SIZE = 4 * 1024 * 1024;
  39     // threshold to grow arrays only by (3/2) instead of 2
  40     static final int THRESHOLD_ARRAY_SIZE;
  41     // threshold to grow arrays only by (5/4) instead of (3/2)
  42     static final long THRESHOLD_HUGE_ARRAY_SIZE;
  43     static final int[] ARRAY_SIZES = new int[BUCKETS];
  44 
  45     static {
  46         // initialize buckets for int/float arrays
  47         int arraySize = MIN_ARRAY_SIZE;
  48 
  49         int inc_lg = 2; // x4




   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.marlin;
  27 
  28 import java.util.Arrays;
  29 import static com.sun.marlin.MarlinUtils.logInfo;
  30 
  31 public final class ArrayCacheConst implements MarlinConst {
  32 
  33     static final int BUCKETS = 8;
  34     static final int MIN_ARRAY_SIZE = 4096;
  35     // maximum array size
  36     static final int MAX_ARRAY_SIZE;
  37     // threshold below to grow arrays by 4
  38     static final int THRESHOLD_SMALL_ARRAY_SIZE = 4 * 1024 * 1024;
  39     // threshold to grow arrays only by (3/2) instead of 2
  40     static final int THRESHOLD_ARRAY_SIZE;
  41     // threshold to grow arrays only by (5/4) instead of (3/2)
  42     static final long THRESHOLD_HUGE_ARRAY_SIZE;
  43     static final int[] ARRAY_SIZES = new int[BUCKETS];
  44 
  45     static {
  46         // initialize buckets for int/float arrays
  47         int arraySize = MIN_ARRAY_SIZE;
  48 
  49         int inc_lg = 2; // x4


< prev index next >