src/hotspot/share/utilities/hashtable.cpp
changeset 52675 7d3cde494494
parent 52673 61b3b58a1d1d
child 52688 3db8758f0f79
equal deleted inserted replaced
52674:c9325aa887da 52675:7d3cde494494
    61 
    61 
    62   if (entry == NULL) {
    62   if (entry == NULL) {
    63     if (_first_free_entry + _entry_size >= _end_block) {
    63     if (_first_free_entry + _entry_size >= _end_block) {
    64       int block_size = MIN2(512, MAX2((int)_table_size / 2, (int)_number_of_entries));
    64       int block_size = MIN2(512, MAX2((int)_table_size / 2, (int)_number_of_entries));
    65       int len = _entry_size * block_size;
    65       int len = _entry_size * block_size;
    66       len = 1 << log2_intptr(len); // round down to power of 2
    66       len = 1 << log2_int(len); // round down to power of 2
    67       assert(len >= _entry_size, "");
    67       assert(len >= _entry_size, "");
    68       _first_free_entry = NEW_C_HEAP_ARRAY2(char, len, F, CURRENT_PC);
    68       _first_free_entry = NEW_C_HEAP_ARRAY2(char, len, F, CURRENT_PC);
    69       _entry_blocks->append(_first_free_entry);
    69       _entry_blocks->append(_first_free_entry);
    70       _end_block = _first_free_entry + len;
    70       _end_block = _first_free_entry + len;
    71     }
    71     }