| 177 | } |
| 178 | |
| 179 | static void tr_push_nested(tr_index_t *ix, tr_file_t *f, const char *name, uint32_t line, |
| 180 | uint32_t first, uint32_t last) { |
| 181 | if (f->nnested == 0 || |
| 182 | (f->nnested >= CBM_SZ_4 && (f->nnested & (f->nnested - SKIP_ONE)) == 0)) { |
| 183 | int ncap = f->nnested ? f->nnested * PAIR_LEN : CBM_SZ_4; |
| 184 | tr_nest_t *g = (tr_nest_t *)cbm_arena_alloc(&ix->arena, (size_t)ncap * sizeof(tr_nest_t)); |
| 185 | if (!g) { |
| 186 | ix->oom = true; |
| 187 | return; |
| 188 | } |
| 189 | if (f->nnested) { |
| 190 | memcpy(g, f->nested, (size_t)f->nnested * sizeof(tr_nest_t)); |
| 191 | } |
| 192 | f->nested = g; |
| 193 | } |
| 194 | f->nested[f->nnested++] = (tr_nest_t){name, line, first, last}; |
| 195 | } |
| 196 | |
| 197 | static void tr_read_record(tr_index_t *ix, tr_file_t *f, const char **fl, const size_t *ln, int n) { |
| 198 | char tag = fl[0][0]; |
no test coverage detected