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; \ |