46 if (!resize_base::is_resize_needed())
48 resize_imp(resize_base::get_new_size(m_num_e, m_num_used_e));
55 do_resize(size_type len)
56 { resize_imp(resize_base::get_nearest_larger_size(len)); }
61 do_resize_if_needed_no_throw()
63 if (!resize_base::is_resize_needed())
68 resize_imp(resize_base::get_new_size(m_num_e, m_num_used_e));
73 PB_DS_ASSERT_VALID((*
this))
79 resize_imp(size_type new_size)
81 PB_DS_ASSERT_VALID((*
this))
82 if (new_size == m_num_e)
85 const size_type old_size = m_num_e;
86 entry_pointer_array a_p_entries_resized;
89 ranged_hash_fn_base::notify_resized(new_size);
94 a_p_entries_resized = s_entry_pointer_allocator.allocate(new_size);
99 ranged_hash_fn_base::notify_resized(old_size);
100 __throw_exception_again;
104 resize_imp_no_exceptions(new_size, a_p_entries_resized, old_size);
105 Resize_Policy::notify_resized(new_size);
106 PB_DS_ASSERT_VALID((*
this))
112 resize_imp_no_exceptions(size_type new_size, entry_pointer_array a_p_entries_resized, size_type old_size)
114 std::fill(a_p_entries_resized, a_p_entries_resized + m_num_e,
117 for (size_type pos = 0; pos < old_size; ++pos)
119 entry_pointer p_e = m_entries[pos];
121 p_e = resize_imp_no_exceptions_reassign_pointer(p_e, a_p_entries_resized, traits_base::m_store_extra_indicator);
125 _GLIBCXX_DEBUG_ONLY(assert_entry_pointer_array_valid(a_p_entries_resized,
126 __FILE__, __LINE__);)
127 s_entry_pointer_allocator.deallocate(m_entries, old_size);
128 m_entries = a_p_entries_resized;
129 PB_DS_ASSERT_VALID((*
this))