Remove duplicate code in PoolArena. (#10174)
Motivation: Remove duplicate code in PoolArena. Modification: Replace duplicate code with `tinyIdx` and `smallIdx`. Result: Clean code.
This commit is contained in:
parent
17f205fab3
commit
ff6d2e4949
@ -321,15 +321,10 @@ abstract class PoolArena<T> implements PoolArenaMetric {
|
||||
int tableIdx;
|
||||
PoolSubpage<T>[] table;
|
||||
if (isTiny(elemSize)) { // < 512
|
||||
tableIdx = elemSize >>> 4;
|
||||
tableIdx = tinyIdx(elemSize);
|
||||
table = tinySubpagePools;
|
||||
} else {
|
||||
tableIdx = 0;
|
||||
elemSize >>>= 10;
|
||||
while (elemSize != 0) {
|
||||
elemSize >>>= 1;
|
||||
tableIdx ++;
|
||||
}
|
||||
tableIdx = smallIdx(elemSize);
|
||||
table = smallSubpagePools;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user