< prev index next >

src/hotspot/share/utilities/bitMap.hpp

Print this page
@@ -159,21 +159,10 @@
    static void clear_range_of_words(bm_word_t* map, idx_t beg, idx_t end);
  
    idx_t count_one_bits_within_word(idx_t beg, idx_t end) const;
    idx_t count_one_bits_in_range_of_words(idx_t beg_full_word, idx_t end_full_word) const;
  
-   // Verification.
- 
-   // Verify size_in_bits does not exceed max_size_in_bits().
-   static void verify_size(idx_t size_in_bits) NOT_DEBUG_RETURN;
-   // Verify bit is less than size().
-   void verify_index(idx_t bit) const NOT_DEBUG_RETURN;
-   // Verify bit is not greater than size().
-   void verify_limit(idx_t bit) const NOT_DEBUG_RETURN;
-   // Verify [beg,end) is a valid range, e.g. beg <= end <= size().
-   void verify_range(idx_t beg, idx_t end) const NOT_DEBUG_RETURN;
- 
    // Allocation Helpers.
  
    // Allocates and clears the bitmap memory.
    template <class Allocator>
    static bm_word_t* allocate(const Allocator&, idx_t size_in_bits, bool clear = true);

@@ -282,20 +271,34 @@
  
    // Clearing
    void clear_large();
    inline void clear();
  
+   // Verification.
+ 
+   // Verify size_in_bits does not exceed max_size_in_bits().
+   static void verify_size(idx_t size_in_bits) NOT_DEBUG_RETURN;
+   // Verify bit is less than size().
+   void verify_index(idx_t bit) const NOT_DEBUG_RETURN;
+   // Verify bit is not greater than size().
+   void verify_limit(idx_t bit) const NOT_DEBUG_RETURN;
+   // Verify [beg,end) is a valid range, e.g. beg <= end <= size().
+   void verify_range(idx_t beg, idx_t end) const NOT_DEBUG_RETURN;
+   
    // Iteration support.  Applies the closure to the index for each set bit,
    // starting from the least index in the range to the greatest, in order.
    // The iteration terminates if the closure returns false.  Returns true if
    // the iteration completed, false if terminated early because the closure
    // returned false.  If the closure modifies the bitmap, modifications to
    // bits at indices greater than the current index will affect which further
    // indices the closure will be applied to.
    // precondition: beg and end form a valid range.
-   bool iterate(BitMapClosure* cl, idx_t beg, idx_t end);
-   bool iterate(BitMapClosure* cl);
+   template <class BitMapClosureType>
+   bool iterate(BitMapClosureType* cl, idx_t beg, idx_t end);
+ 
+   template <class BitMapClosureType>
+   bool iterate(BitMapClosureType* cl);
  
    // Looking for 1's and 0's at indices equal to or greater than "l_index",
    // stopping if none has been found before "r_index", and returning
    // "r_index" (which must be at most "size") in that case.
    idx_t get_next_one_offset (idx_t l_index, idx_t r_index) const;
< prev index next >