--- old/src/share/vm/gc_implementation/g1/g1CardCounts.hpp 2013-05-14 14:04:40.265808491 -0700 +++ new/src/share/vm/gc_implementation/g1/g1CardCounts.hpp 2013-05-14 14:04:40.061799773 -0700 @@ -94,6 +94,14 @@ return (jbyte*) (_ct_bot + card_num); } + // Helper routine. + // Returns the number of cards that can be counted by the given committed + // table size, with a maximum of the number of cards spanned by the max + // capacity of the heap. + size_t committed_to_card_num(size_t committed_size) { + return MIN2(_reserved_max_card_num, committed_size / sizeof(jbyte)); + } + // Clear the counts table for the given (exclusive) index range. void clear_range(size_t from_card_num, size_t to_card_num);