8154838: G1CardLiveData::free_large_bitmap() uses wrong calculation to determine the number of words
Summary: Use the exact same calculation as G1CardLiveData::allocate_large_bitmap() in free_large_bitmap().
Reviewed-by: stefank, jmasa
--- a/hotspot/src/share/vm/gc/g1/g1CardLiveData.cpp Thu Apr 21 20:49:11 2016 -0700
+++ b/hotspot/src/share/vm/gc/g1/g1CardLiveData.cpp Fri Apr 22 10:19:22 2016 +0200
@@ -60,7 +60,7 @@
}
void G1CardLiveData::free_large_bitmap(bm_word_t* bitmap, size_t size_in_bits) {
- MmapArrayAllocator<bm_word_t, mtGC>::free(bitmap, size_in_bits / BitsPerWord);
+ MmapArrayAllocator<bm_word_t, mtGC>::free(bitmap, BitMap::calc_size_in_words(size_in_bits));
}
void G1CardLiveData::initialize(size_t max_capacity, uint num_max_regions) {