pageShifts to be defined prior to inclusion,
and it in turn defines:
LOG2_SIZE_CLASS_GROUP: Log of size class count for each size doubling. LOG2_MAX_LOOKUP_SIZE: Log of max size class in the lookup table. sizeClasses: Complete table of [index, log2Group, log2Delta, nDelta, isMultiPageSize, isSubPage, log2DeltaLookup] tuples. index: Size class index. log2Group: Log of group base size (no deltas added). log2Delta: Log of delta to previous size class. nDelta: Delta multiplier. isMultiPageSize: 'yes' if a multiple of the page size, 'no' otherwise. isSubPage: 'yes' if a subpage size class, 'no' otherwise. log2DeltaLookup: Same as log2Delta if a lookup table size class, 'no' otherwise.
nSubpages: Number of subpages size classes. nSizes: Number of size classes. nPSizes: Number of size classes that are multiples of pageSize. smallMaxSizeIdx: Maximum small size class index. lookupMaxClass: Maximum size class included in lookup table. log2NormalMinClass: Log of minimum normal size class.
The first size class and spacing are 1 << LOG2_QUANTUM. Each group has 1 << LOG2_SIZE_CLASS_GROUP of size classes. size = 1 << log2Group + nDelta * (1 << log2Delta) The first size class has an unusual encoding, because the size has to be split between group and delta*nDelta. If pageShift = 13, sizeClasses looks like this: (index, log2Group, log2Delta, nDelta, isMultiPageSize, isSubPage, log2DeltaLookup)
( 0, 4, 4, 0, no, yes, 4) ( 1, 4, 4, 1, no, yes, 4) ( 2, 4, 4, 2, no, yes, 4) ( 3, 4, 4, 3, no, yes, 4)
( 4, 6, 4, 1, no, yes, 4) ( 5, 6, 4, 2, no, yes, 4) ( 6, 6, 4, 3, no, yes, 4) ( 7, 6, 4, 4, no, yes, 4)
( 8, 7, 5, 1, no, yes, 5) ( 9, 7, 5, 2, no, yes, 5) ( 10, 7, 5, 3, no, yes, 5) ( 11, 7, 5, 4, no, yes, 5) ... ... ( 72, 23, 21, 1, yes, no, no) ( 73, 23, 21, 2, yes, no, no) ( 74, 23, 21, 3, yes, no, no) ( 75, 23, 21, 4, yes, no, no)
( 76, 24, 22, 1, yes, no, no)
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final int | |
| pack-priv final int | |
| private static final int | |
| private static final int | |
| pack-priv static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| pack-priv final int | |
| private static final int | |
| private static final byte | |
| pack-priv final int | |
| pack-priv final int | |
| pack-priv final int | |
| private final int[] | |
| pack-priv final int | |
| pack-priv final int | |
| private static final int | |
| private final int[] | |
| private final int[] | |
| pack-priv final int | |
| private static final int | |
| private static final byte |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private static int | |
| private static int | |
| private static int[] | |
| private static int[] | |
| private static int[] | |
| private static short[] | |
| public int | normalizeSize(int
request size size)Implements io. |
| private static int | |
| public long | pageIdx2size(int pageIdx)
Implements io. |
| public long | pageIdx2sizeCompute(int pageIdx)
Implements io. |
| public int | pages2pageIdx(int
multiples of pageSizes pages)Implements io. |
| private int | |
| public int | pages2pageIdxFloor(int
multiples of pageSizes pages)Implements io. |
| public int | size2SizeIdx(int
request size size)Implements io. |
| public int | sizeIdx2size(int sizeIdx)
Implements io. |
| public int | sizeIdx2sizeCompute(int sizeIdx)
Implements io. |
| private static int |
| chunkSize | back to summary |
|---|---|
| pack-priv final int chunkSize | |
| directMemoryCacheAlignment | back to summary |
|---|---|
| pack-priv final int directMemoryCacheAlignment | |
| LOG2_DELTA_LOOKUP_IDX | back to summary |
|---|---|
| private static final int LOG2_DELTA_LOOKUP_IDX | |
| LOG2_MAX_LOOKUP_SIZE | back to summary |
|---|---|
| private static final int LOG2_MAX_LOOKUP_SIZE | |
| LOG2_QUANTUM | back to summary |
|---|---|
| pack-priv static final int LOG2_QUANTUM | |
| LOG2_SIZE_CLASS_GROUP | back to summary |
|---|---|
| private static final int LOG2_SIZE_CLASS_GROUP | |
| LOG2DELTA_IDX | back to summary |
|---|---|
| private static final int LOG2DELTA_IDX | |
| LOG2GROUP_IDX | back to summary |
|---|---|
| private static final int LOG2GROUP_IDX | |
| lookupMaxSize | back to summary |
|---|---|
| pack-priv final int lookupMaxSize | |
| NDELTA_IDX | back to summary |
|---|---|
| private static final int NDELTA_IDX | |
| no | back to summary |
|---|---|
| private static final byte no | |
| nPSizes | back to summary |
|---|---|
| pack-priv final int nPSizes | |
| nSizes | back to summary |
|---|---|
| pack-priv final int nSizes | |
| nSubpages | back to summary |
|---|---|
| pack-priv final int nSubpages | |
| pageIdx2sizeTab | back to summary |
|---|---|
| private final int[] pageIdx2sizeTab | |
| pageShifts | back to summary |
|---|---|
| pack-priv final int pageShifts | |
| pageSize | back to summary |
|---|---|
| pack-priv final int pageSize | |
| PAGESIZE_IDX | back to summary |
|---|---|
| private static final int PAGESIZE_IDX | |
| size2idxTab | back to summary |
|---|---|
| private final int[] size2idxTab | |
| sizeIdx2sizeTab | back to summary |
|---|---|
| private final int[] sizeIdx2sizeTab | |
| smallMaxSizeIdx | back to summary |
|---|---|
| pack-priv final int smallMaxSizeIdx | |
| SUBPAGE_IDX | back to summary |
|---|---|
| private static final int SUBPAGE_IDX | |
| yes | back to summary |
|---|---|
| private static final byte yes | |
| SizeClasses | back to summary |
|---|---|
| pack-priv SizeClasses(int pageSize, int pageShifts, int chunkSize, int directMemoryCacheAlignment) | |
| alignSizeIfNeeded | back to summary |
|---|---|
| private static int alignSizeIfNeeded(int size, int directMemoryCacheAlignment) | |
| calculateSize | back to summary |
|---|---|
| private static int calculateSize(int log2Group, int nDelta, int log2Delta) | |
| newIdx2SizeTab | back to summary |
|---|---|
| private static int[] newIdx2SizeTab(short[][] sizeClasses, int nSizes, int directMemoryCacheAlignment) | |
| newPageIdx2sizeTab | back to summary |
|---|---|
| private static int[] newPageIdx2sizeTab(short[][] sizeClasses, int nSizes, int nPSizes, int directMemoryCacheAlignment) | |
| newSize2idxTab | back to summary |
|---|---|
| private static int[] newSize2idxTab(int lookupMaxSize, short[][] sizeClasses) | |
| newSizeClass | back to summary |
|---|---|
| private static short[] newSizeClass(int index, int log2Group, int log2Delta, int nDelta, int pageShifts) | |
| normalizeSize | back to summary |
|---|---|
| public int normalizeSize(int size) Implements io. Doc from io. Normalizes usable size that would result from allocating an object with the specified size and alignment.
| |
| normalizeSizeCompute | back to summary |
|---|---|
| private static int normalizeSizeCompute(int size) | |
| pageIdx2size | back to summary |
|---|---|
| public long pageIdx2size(int pageIdx) Implements io. Doc from io. Computes size from lookup table according to pageIdx.
| |
| pageIdx2sizeCompute | back to summary |
|---|---|
| public long pageIdx2sizeCompute(int pageIdx) Implements io. Doc from io. Computes size according to pageIdx.
| |
| pages2pageIdx | back to summary |
|---|---|
| public int pages2pageIdx(int pages) Implements io. Doc from io. Normalizes request size up to the nearest pageSize class.
| |
| pages2pageIdxCompute | back to summary |
|---|---|
| private int pages2pageIdxCompute(int pages, boolean floor) | |
| pages2pageIdxFloor | back to summary |
|---|---|
| public int pages2pageIdxFloor(int pages) Implements io. Doc from io. Normalizes request size down to the nearest pageSize class.
| |
| size2SizeIdx | back to summary |
|---|---|
| public int size2SizeIdx(int size) Implements io. Doc from io. Normalizes request size up to the nearest size class.
| |
| sizeIdx2size | back to summary |
|---|---|
| public int sizeIdx2size(int sizeIdx) Implements io. Doc from io. Computes size from lookup table according to sizeIdx.
| |
| sizeIdx2sizeCompute | back to summary |
|---|---|
| public int sizeIdx2sizeCompute(int sizeIdx) Implements io. Doc from io. Computes size according to sizeIdx.
| |
| sizeOf | back to summary |
|---|---|
| private static int sizeOf(short[] sizeClass, int directMemoryCacheAlignment) | |