8234127: BasicHashtable does not support small table_size
authormanc
Wed, 13 Nov 2019 16:49:14 -0800
changeset 59097 148921c01038
parent 59096 e6baa47fbacf
child 59098 124164752fe4
8234127: BasicHashtable does not support small table_size Reviewed-by: coleenp, jiangli
src/hotspot/share/utilities/hashtable.cpp
--- a/src/hotspot/share/utilities/hashtable.cpp	Thu Nov 14 12:42:44 2019 -0800
+++ b/src/hotspot/share/utilities/hashtable.cpp	Wed Nov 13 16:49:14 2019 -0800
@@ -61,7 +61,7 @@
 
   if (entry == NULL) {
     if (_first_free_entry + _entry_size >= _end_block) {
-      int block_size = MIN2(512, MAX2((int)_table_size / 2, (int)_number_of_entries));
+      int block_size = MIN2(512, MAX3(2, (int)_table_size / 2, (int)_number_of_entries));
       int len = _entry_size * block_size;
       len = 1 << log2_int(len); // round down to power of 2
       assert(len >= _entry_size, "");