MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / next_capacity

Function next_capacity

extern/boost/boost/container/vector.hpp:473–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

471
472 template<class GrowthFactorType>
473 size_type next_capacity(size_type additional_objects) const
474 {
475 BOOST_ASSERT(additional_objects > size_type(this->m_capacity - this->m_size));
476 size_type max = allocator_traits_type::max_size(this->alloc());
477 (clamp_by_stored_size_type<size_type>)(max, stored_size_type());
478 const size_type remaining_cap = size_type(max - size_type(this->m_capacity));
479 const size_type min_additional_cap = size_type(additional_objects - size_type(this->m_capacity - this->m_size));
480
481 if ( remaining_cap < min_additional_cap )
482 boost::container::throw_length_error("get_next_capacity, allocator's max size reached");
483
484 return GrowthFactorType()( size_type(this->m_capacity), min_additional_cap, max);
485 }
486
487 pointer m_start;
488 stored_size_type m_size;

Callers

nothing calls this directly

Calls 2

throw_length_errorFunction · 0.85
allocMethod · 0.45

Tested by

no test coverage detected