MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / array_ensure_cap

Function array_ensure_cap

src/util/arr.h:97–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95#define array_newlen(T, len) (T *)(array_new_sz(sizeof(T), len, len))
96
97static inline array_t array_ensure_cap(array_t arr, uint32_t cap) {
98 array_hdr_t *hdr = array_hdr(arr);
99 if(cap > hdr->cap) {
100 hdr->cap = MAX(hdr->cap * 2, cap);
101 hdr = (array_hdr_t *)array_realloc_fn(hdr, array_sizeof(hdr));
102 }
103 return (array_t)hdr->buf;
104}
105
106// Reallocates the array setting the new capacity. If there were more
107// elements, those are deleted (cut off), if less, then there will be

Callers 10

RdbLoadGraphSchema_v13Function · 0.85
RdbLoadGraphSchema_v11Function · 0.85
RdbLoadGraphSchema_v9Function · 0.85
RdbLoadGraphSchema_v10Function · 0.85
RdbLoadGraphSchema_v8Function · 0.85
RdbLoadGraphSchema_v12Function · 0.85
array_growFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected