id = this->m_symtab->assign_summary_id (node);
if ((unsigned int)id >= m_vector->length ())
- vec_safe_grow_cleared (m_vector,
- this->m_symtab->cgraph_max_summary_id);
+ {
+ int newlen = this->m_symtab->cgraph_max_summary_id;
+ vec_safe_reserve (m_vector, newlen - m_vector->length ());
+ m_vector->quick_grow_cleared (newlen);
+ }
if ((*m_vector)[id] == NULL)
(*m_vector)[id] = this->allocate_new ();
id = this->m_symtab->assign_summary_id (edge);
if ((unsigned)id >= m_vector->length ())
- vec_safe_grow_cleared (m_vector, this->m_symtab->edges_max_summary_id);
+ {
+ int newlen = this->m_symtab->edges_max_summary_id;
+ m_vector->reserve (newlen - m_vector->length ());
+ m_vector->quick_grow_cleared (newlen);
+ }
if ((*m_vector)[id] == NULL)
(*m_vector)[id] = this->allocate_new ();
v->safe_grow_cleared (len PASS_MEM_STAT);
}
+/* If V does not have space for NELEMS elements, call
+ V->reserve(NELEMS, EXACT). */
+
+template<typename T>
+inline bool
+vec_safe_reserve (vec<T, va_heap, vl_ptr> *&v, unsigned nelems, bool exact = false
+ CXX_MEM_STAT_INFO)
+{
+ return v->reserve (nelems, exact);
+}
+
/* If V is NULL return false, otherwise return V->iterate(IX, PTR). */
template<typename T, typename A>