MCPcopy Create free account
hub / github.com/Shannon-Data/ShannonBase / ~Prealloced_array

Method ~Prealloced_array

include/prealloced_array.h:215–220  ·  view source on GitHub ↗

Runs DTOR on all elements if needed. Deallocates array if we exceeded the Preallocated amount. */

Source from the content-addressed store, hash-verified

213 Deallocates array if we exceeded the Preallocated amount.
214 */
215 ~Prealloced_array() {
216 if (!Has_trivial_destructor) {
217 clear();
218 }
219 if (!using_inline_buffer()) my_free(m_ext.m_array_ptr);
220 }
221
222 size_t capacity() const {
223 return using_inline_buffer() ? Prealloc : m_ext.m_alloced_capacity;

Callers 1

shrink_to_fitMethod · 0.95

Calls 2

clearFunction · 0.50
my_freeFunction · 0.50

Tested by

no test coverage detected