File tree 1 file changed +7
-6
lines changed
src/hotspot/share/gc/shenandoah
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -225,10 +225,11 @@ class ShenandoahMarkTask
225
225
class ShenandoahMarkTask
226
226
{
227
227
private:
228
- enum {
229
- chunk_bits = 10 ,
230
- pow_bits = 5 ,
231
- };
228
+ static const uint8_t chunk_bits = 10 ;
229
+ static const uint8_t pow_bits = 5 ;
230
+
231
+ static const int chunk_max = nth_bit(chunk_bits) - 1 ;
232
+ static const int pow_max = nth_bit(pow_bits) - 1 ;
232
233
233
234
oop _obj;
234
235
int _chunk;
@@ -237,8 +238,8 @@ class ShenandoahMarkTask
237
238
public:
238
239
ShenandoahMarkTask (oop o = NULL , int chunk = 0 , int pow = 0 ):
239
240
_obj (o), _chunk(chunk), _pow(pow) {
240
- assert (0 <= chunk && chunk < nth_bit (chunk_bits) , " chunk is sane : %d" , chunk);
241
- assert (0 <= pow && pow < nth_bit (pow_bits) , " pow is sane : %d" , pow );
241
+ assert (0 <= chunk && chunk <= chunk_max , " chunk is in range : %d" , chunk);
242
+ assert (0 <= pow && pow <= pow_max , " pow is in range : %d" , pow );
242
243
}
243
244
244
245
// Trivially copyable.
You can’t perform that action at this time.
0 commit comments