8154838: G1CardLiveData::free_large_bitmap() uses wrong calculation to determine the number of words
authortschatzl
Fri, 22 Apr 2016 10:19:22 +0200
changeset 38061 5fe046aef3b9
parent 38059 86ab3f0a9f87
child 38062 430e0a96ef1f
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
hotspot/src/share/vm/gc/g1/g1CardLiveData.cpp
--- 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) {