MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / _array__grow

Function _array__grow

codegraph-kernel/grammars/swift/tree_sitter/array.h:242–253  ·  view source on GitHub ↗

This is not what you're looking for, see `array_push` or `array_grow_by`.

Source from the content-addressed store, hash-verified

240
241/// This is not what you're looking for, see `array_push` or `array_grow_by`.
242static inline void *_array__grow(void *contents, uint32_t size, uint32_t *capacity,
243 uint32_t count, size_t element_size) {
244 void *new_contents = contents;
245 uint32_t new_size = size + count;
246 if (new_size > *capacity) {
247 uint32_t new_capacity = *capacity * 2;
248 if (new_capacity < 8) new_capacity = 8;
249 if (new_capacity < new_size) new_capacity = new_size;
250 new_contents = _array__reserve(contents, capacity, element_size, new_capacity);
251 }
252 return new_contents;
253}
254
255/// This is not what you're looking for, see `array_splice`.
256static inline void *_array__splice(void *self_contents, uint32_t *size, uint32_t *capacity,

Callers

nothing calls this directly

Calls 1

_array__reserveFunction · 0.70

Tested by

no test coverage detected