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

Function iq_grow

modules/http2/h2_proxy_util.c:329–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

327}
328
329static 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
349static void iq_swap(h2_proxy_iqueue *q, int i, int j)
350{

Callers 2

h2_proxy_iq_createFunction · 0.70
h2_proxy_iq_addFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected