47 if (!resize_base::is_resize_needed())
49 resize_imp(resize_base::get_new_size(m_num_e, m_num_used_e));
56 do_resize(size_type n)
57 { resize_imp(resize_base::get_nearest_larger_size(n)); }
62 do_resize_if_needed_no_throw()
64 if (!resize_base::is_resize_needed())
69 resize_imp(resize_base::get_new_size(m_num_e, m_num_used_e));
74 PB_DS_ASSERT_VALID((*
this))
80 resize_imp(size_type new_size)
82 #ifdef PB_DS_REGRESSION
83 typename _Alloc::group_adjustor adjust(m_num_e);
86 if (new_size == m_num_e)
89 PB_DS_ASSERT_VALID((*
this))
90 const size_type old_size = m_num_e;
91 entry_array a_entries_resized = 0;
94 a_entries_resized = s_entry_allocator.allocate(new_size);
96 ranged_probe_fn_base::notify_resized(new_size);
99 for (size_type i = 0; i < m_num_e; ++i)
100 a_entries_resized[i].m_stat = empty_entry_status;
104 resize_imp(a_entries_resized, old_size);
108 erase_all_valid_entries(a_entries_resized, new_size);
110 s_entry_allocator.deallocate(a_entries_resized, new_size);
111 ranged_probe_fn_base::notify_resized(old_size);
112 __throw_exception_again;
116 _GLIBCXX_DEBUG_ONLY(assert_entry_array_valid(a_entries_resized,
117 traits_base::m_store_extra_indicator,
118 __FILE__, __LINE__);)
120 Resize_Policy::notify_resized(new_size);
121 erase_all_valid_entries(m_entries, old_size);
122 s_entry_allocator.deallocate(m_entries, old_size);
123 m_entries = a_entries_resized;
124 PB_DS_ASSERT_VALID((*
this))
130 resize_imp(entry_array a_entries_resized, size_type old_size)
132 for (size_type pos = 0; pos < old_size; ++pos)
133 if (m_entries[pos].m_stat == valid_entry_status)
134 resize_imp_reassign(m_entries + pos, a_entries_resized,
135 traits_base::m_store_extra_indicator);