comparison src/share/vm/memory/space.hpp @ 10287:12f651e29f6b

6843347: Boundary values in some public GC options cause crashes Summary: Setting some public integer options to specific values causes crashes or undefined GC behavior. This patchset adds the necessary argument checking for these options. Reviewed-by: jmasa, brutisso
author tschatzl
date Wed, 15 May 2013 11:05:09 +0200
parents db9981fd3124
children de6a9e811145 bdd155477289
comparison
equal deleted inserted replaced
10286:0a2986f36965 10287:12f651e29f6b
535 /* We allow some amount of garbage towards the bottom of the space, so \ 535 /* We allow some amount of garbage towards the bottom of the space, so \
536 * we don't start compacting before there is a significant gain to be made.\ 536 * we don't start compacting before there is a significant gain to be made.\
537 * Occasionally, we want to ensure a full compaction, which is determined \ 537 * Occasionally, we want to ensure a full compaction, which is determined \
538 * by the MarkSweepAlwaysCompactCount parameter. \ 538 * by the MarkSweepAlwaysCompactCount parameter. \
539 */ \ 539 */ \
540 int invocations = MarkSweep::total_invocations(); \ 540 uint invocations = MarkSweep::total_invocations(); \
541 bool skip_dead = (MarkSweepAlwaysCompactCount < 1) \ 541 bool skip_dead = ((invocations % MarkSweepAlwaysCompactCount) != 0); \
542 ||((invocations % MarkSweepAlwaysCompactCount) != 0); \
543 \ 542 \
544 size_t allowed_deadspace = 0; \ 543 size_t allowed_deadspace = 0; \
545 if (skip_dead) { \ 544 if (skip_dead) { \
546 const size_t ratio = allowed_dead_ratio(); \ 545 const size_t ratio = allowed_dead_ratio(); \
547 allowed_deadspace = (capacity() * ratio / 100) / HeapWordSize; \ 546 allowed_deadspace = (capacity() * ratio / 100) / HeapWordSize; \