Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8234628

Change BasicHashTables::new_entry() to use clamp()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 15
    • 14
    • hotspot
    • b26

      The changes in JDK-8233702 added a clamp() function to clamp a value between given min and max, with the assert checking whether min <= max.

      Attempting to use this method in

      hashtable.cpp:

      template <MEMFLAGS F> BasicHashtableEntry<F>* BasicHashtable<F>::new_entry(unsigned int hashValue) {

      64: int block_size = MIN2(512, MAX2((int)_table_size / 2, (int)_number_of_entries));

      caused the assert to fail which indicates a potential issue with the calculation, i.e. unexpected return values, and so unexpected size of the hash table

      Please look at the method/calculation and if the clamp() method should be used, and if so use it after fixing the code. Otherwise it would be nice to add an explanation why the method is not used/why the code is as is.

      Otherwise just close out this issue.

            iklam Ioi Lam
            tschatzl Thomas Schatzl
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: