Routine for cloning a comprehension function's private data.
| 44 | |
| 45 | // Routine for cloning a comprehension function's private data. |
| 46 | void *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 | |
| 67 | static void _PopulateReduceCtx |
| 68 | ( |
nothing calls this directly
no test coverage detected