MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / ListReduceCtx_Clone

Function ListReduceCtx_Clone

src/arithmetic/list_funcs/list_funcs.c:46–65  ·  view source on GitHub ↗

Routine for cloning a comprehension function's private data.

Source from the content-addressed store, hash-verified

44
45// Routine for cloning a comprehension function's private data.
46void *ListReduceCtx_Clone
47(
48 void *orig
49) {
50 ListReduceCtx *ctx = orig;
51 // allocate space for the clone
52 ListReduceCtx *clone = rm_malloc(sizeof(ListReduceCtx));
53
54 // clone the variadic node
55 clone->record = NULL;
56 clone->variable_idx = ctx->variable_idx;
57 clone->variable = ctx->variable;
58 clone->accumulator_idx = ctx->accumulator_idx;
59 clone->accumulator = ctx->accumulator;
60
61 // clone the eval routine
62 clone->exp = AR_EXP_Clone(ctx->exp);
63
64 return clone;
65}
66
67static void _PopulateReduceCtx
68(

Callers

nothing calls this directly

Calls 2

rm_mallocFunction · 0.85
AR_EXP_CloneFunction · 0.85

Tested by

no test coverage detected