| 95 | #define array_newlen(T, len) (T *)(array_new_sz(sizeof(T), len, len)) |
| 96 | |
| 97 | static 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 |
no outgoing calls
no test coverage detected