MCPcopy Create free account
hub / github.com/crownengine/crown / reserve

Method reserve

3rdparty/bx/include/tinystl/string.h:165–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163
164 template<typename allocator>
165 inline void basic_string<allocator>::reserve(size_t capacity) {
166 if (m_first + capacity + 1 <= m_capacity)
167 return;
168
169 const ptrdiff_t size = m_last - m_first;
170
171 pointer newfirst = (pointer)allocator::static_allocate(capacity + 1);
172 for (pointer it = m_first, newit = newfirst, end = m_last; it != end; ++it, ++newit)
173 *newit = *it;
174 if (m_first != m_buffer)
175 allocator::static_deallocate(m_first, m_capacity - m_first);
176
177 m_first = newfirst;
178 m_last = newfirst + size;
179 m_capacity = m_first + capacity;
180 }
181
182 template<typename allocator>
183 inline void basic_string<allocator>::resize(size_t size) {

Callers 13

filter.cppFile · 0.45
source.cppFile · 0.45
buffer.cppFile · 0.45
auxeffectslot.cppFile · 0.45
effect.cppFile · 0.45
initMethod · 0.45
BuildBFormatHrtfFunction · 0.45
loadMethod · 0.45
probe_devicesFunction · 0.45
ProbePlaybackDevicesFunction · 0.45
ProbeCaptureDevicesFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected