MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / redisReaderGrow

Function redisReaderGrow

deps/hiredis/read.c:423–446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

421}
422
423static int redisReaderGrow(redisReader *r) {
424 redisReadTask **aux;
425 int newlen;
426
427 /* Grow our stack size */
428 newlen = r->tasks + REDIS_READER_STACK_SIZE;
429 aux = hi_realloc(r->task, sizeof(*r->task) * newlen);
430 if (aux == NULL)
431 goto oom;
432
433 r->task = aux;
434
435 /* Allocate new tasks */
436 for (; r->tasks < newlen; r->tasks++) {
437 r->task[r->tasks] = hi_calloc(1, sizeof(**r->task));
438 if (r->task[r->tasks] == NULL)
439 goto oom;
440 }
441
442 return REDIS_OK;
443oom:
444 __redisReaderSetErrorOOM(r);
445 return REDIS_ERR;
446}
447
448/* Process the array, map and set types. */
449static int processAggregateItem(redisReader *r) {

Callers 1

processAggregateItemFunction · 0.85

Calls 3

__redisReaderSetErrorOOMFunction · 0.85
hi_reallocFunction · 0.70
hi_callocFunction · 0.70

Tested by

no test coverage detected