MCPcopy Create free account
hub / github.com/apache/httpd / iq_grow

Function iq_grow

modules/http2/h2_util.c:460–478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

458}
459
460static void iq_grow(h2_iqueue *q, int nlen)
461{
462 if (nlen > q->nalloc) {
463 int *nq = apr_pcalloc(q->pool, sizeof(int) * nlen);
464 if (q->nelts > 0) {
465 int l = ((q->head + q->nelts) % q->nalloc) - q->head;
466
467 memmove(nq, q->elts + q->head, sizeof(int) * l);
468 if (l < q->nelts) {
469 /* elts wrapped, append elts in [0, remain] to nq */
470 int remain = q->nelts - l;
471 memmove(nq + l, q->elts, sizeof(int) * remain);
472 }
473 }
474 q->elts = nq;
475 q->nalloc = nlen;
476 q->head = 0;
477 }
478}
479
480static void iq_swap(h2_iqueue *q, int i, int j)
481{

Callers 2

h2_iq_createFunction · 0.70
h2_iq_addFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected