170 |
|
|
171 |
|
/** |
172 |
|
* Maximum work-stealing queue array size. Must be less than or |
173 |
< |
* equal to 1 << 28 to ensure lack of index wraparound. (This |
174 |
< |
* is less than usual bounds, because we need leftshift by 3 |
175 |
< |
* to be in int range). |
173 |
> |
* equal to 1 << (31 - width of array entry) to ensure lack of |
174 |
> |
* index wraparound. The value is set in the static block |
175 |
> |
* at the end of this file after obtaining width. |
176 |
|
*/ |
177 |
< |
private static final int MAXIMUM_QUEUE_CAPACITY = 1 << 28; |
177 |
> |
private static final int MAXIMUM_QUEUE_CAPACITY; |
178 |
|
|
179 |
|
/** |
180 |
|
* The pool this thread works in. Accessed directly by ForkJoinTask. |
1159 |
|
if ((s & (s-1)) != 0) |
1160 |
|
throw new Error("data type scale not a power of two"); |
1161 |
|
qShift = 31 - Integer.numberOfLeadingZeros(s); |
1162 |
+ |
MAXIMUM_QUEUE_CAPACITY = 1 << (31 - qShift); |
1163 |
|
} |
1164 |
|
|
1165 |
|
private static long objectFieldOffset(String field, Class<?> klazz) { |