| 327 | } |
| 328 | |
| 329 | static void iq_grow(h2_proxy_iqueue *q, int nlen) |
| 330 | { |
| 331 | if (nlen > q->nalloc) { |
| 332 | int *nq = apr_pcalloc(q->pool, sizeof(int) * nlen); |
| 333 | if (q->nelts > 0) { |
| 334 | int l = ((q->head + q->nelts) % q->nalloc) - q->head; |
| 335 | |
| 336 | memmove(nq, q->elts + q->head, sizeof(int) * l); |
| 337 | if (l < q->nelts) { |
| 338 | /* elts wrapped, append elts in [0, remain] to nq */ |
| 339 | int remain = q->nelts - l; |
| 340 | memmove(nq + l, q->elts, sizeof(int) * remain); |
| 341 | } |
| 342 | } |
| 343 | q->elts = nq; |
| 344 | q->nalloc = nlen; |
| 345 | q->head = 0; |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | static void iq_swap(h2_proxy_iqueue *q, int i, int j) |
| 350 | { |
no outgoing calls
no test coverage detected