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

Function _array__grow

codegraph-kernel/grammars/swift/tree_sitter/array.h:248–259  ·  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

246
247/// This is not what you're looking for, see `array_push` or `array_grow_by`.
248static inline void *_array__grow(void *contents, uint32_t size, uint32_t *capacity,
249 uint32_t count, size_t element_size) {
250 void *new_contents = contents;
251 uint32_t new_size = size + count;
252 if (new_size > *capacity) {
253 uint32_t new_capacity = *capacity * 2;
254 if (new_capacity < 8) new_capacity = 8;
255 if (new_capacity < new_size) new_capacity = new_size;
256 new_contents = _array__reserve(contents, capacity, element_size, new_capacity);
257 }
258 return new_contents;
259}
260
261/// This is not what you're looking for, see `array_splice`.
262static 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