41#ifdef PB_DS_CLASS_C_DEC
48 if (!resize_base::is_resize_needed())
50 resize_imp(resize_base::get_new_size(m_num_e, m_num_used_e));
58{ resize_imp(resize_base::get_nearest_larger_size(n)); }
63do_resize_if_needed_no_throw()
65 if (!resize_base::is_resize_needed())
70 resize_imp(resize_base::get_new_size(m_num_e, m_num_used_e));
75 PB_DS_ASSERT_VALID((*
this))
81resize_imp(size_type new_size)
83#ifdef PB_DS_REGRESSION
84 typename _Alloc::group_adjustor adjust(m_num_e);
87 if (new_size == m_num_e)
90 PB_DS_ASSERT_VALID((*
this))
91 const size_type old_size = m_num_e;
92 entry_array a_entries_resized = 0;
95 a_entries_resized = s_entry_allocator.allocate(new_size);
97 ranged_probe_fn_base::notify_resized(new_size);
100 for (size_type i = 0; i < m_num_e; ++i)
101 a_entries_resized[i].m_stat = empty_entry_status;
105 resize_imp(a_entries_resized, old_size);
109 erase_all_valid_entries(a_entries_resized, new_size);
111 s_entry_allocator.deallocate(a_entries_resized, new_size);
112 ranged_probe_fn_base::notify_resized(old_size);
113 __throw_exception_again;
117 _GLIBCXX_DEBUG_ONLY(assert_entry_array_valid(a_entries_resized,
118 traits_base::m_store_extra_indicator,
119 __FILE__, __LINE__);)
121 Resize_Policy::notify_resized(new_size);
122 erase_all_valid_entries(m_entries, old_size);
123 s_entry_allocator.deallocate(m_entries, old_size);
124 m_entries = a_entries_resized;
125 PB_DS_ASSERT_VALID((*
this))
131resize_imp(entry_array a_entries_resized, size_type old_size)
133 for (size_type pos = 0; pos < old_size; ++pos)
134 if (m_entries[pos].m_stat == valid_entry_status)
135 resize_imp_reassign(m_entries + pos, a_entries_resized,
136 traits_base::m_store_extra_indicator);