< prev index next >

src/hotspot/share/utilities/bitMap.hpp

Print this page
rev 57380 : [mq]: metaspace-improvement

@@ -193,10 +193,11 @@
 
   static idx_t calc_size_in_bytes(size_t size_in_bits) {
     return calc_size_in_words(size_in_bits) * BytesPerWord;
   }
 
+  // Size, in number of bits, of this map.
   idx_t size() const          { return _size; }
   idx_t size_in_words() const { return calc_size_in_words(size()); }
   idx_t size_in_bytes() const { return calc_size_in_bytes(size()); }
 
   bool at(idx_t index) const {

@@ -251,15 +252,15 @@
 
   // Clearing
   void clear_large();
   inline void clear();
 
-  // Iteration support.  Returns "true" if the iteration completed, false
+  // Iteration support [leftIndex, rightIndex).  Returns "true" if the iteration completed, false
   // if the iteration terminated early (because the closure "blk" returned
   // false).
-  bool iterate(BitMapClosure* blk, idx_t leftIndex, idx_t rightIndex);
-  bool iterate(BitMapClosure* blk) {
+  bool iterate(BitMapClosure* blk, idx_t leftIndex, idx_t rightIndex) const;
+  bool iterate(BitMapClosure* blk) const {
     // call the version that takes an interval
     return iterate(blk, 0, size());
   }
 
   // Looking for 1's and 0's at indices equal to or greater than "l_index",

@@ -277,10 +278,13 @@
 
   // Like "get_next_one_offset", except requires that "r_index" is
   // aligned to bitsizeof(bm_word_t).
   idx_t get_next_one_offset_aligned_right(idx_t l_index, idx_t r_index) const;
 
+  // Returns the number of bits set between [l_index, r_index) in the bitmap.
+  idx_t count_one_bits(idx_t l_index, idx_t r_index) const;
+
   // Returns the number of bits set in the bitmap.
   idx_t count_one_bits() const;
 
   // Set operations.
   void set_union(const BitMap& bits);
< prev index next >