* Add another expression evaluation step to ExprState->steps. * * Note that this potentially re-allocates es->steps, therefore no pointer * into that array may be used while the expression is still being built. */
| 2519 | * into that array may be used while the expression is still being built. |
| 2520 | */ |
| 2521 | void |
| 2522 | ExprEvalPushStep(ExprState *es, const ExprEvalStep *s) |
| 2523 | { |
| 2524 | if (es->steps_alloc == 0) |
| 2525 | { |
| 2526 | es->steps_alloc = 16; |
| 2527 | es->steps = palloc(sizeof(ExprEvalStep) * es->steps_alloc); |
| 2528 | } |
| 2529 | else if (es->steps_alloc == es->steps_len) |
| 2530 | { |
| 2531 | es->steps_alloc *= 2; |
| 2532 | es->steps = repalloc(es->steps, |
| 2533 | sizeof(ExprEvalStep) * es->steps_alloc); |
| 2534 | } |
| 2535 | |
| 2536 | memcpy(&es->steps[es->steps_len++], s, sizeof(ExprEvalStep)); |
| 2537 | } |
| 2538 | |
| 2539 | /* |
| 2540 | * Perform setup necessary for the evaluation of a function-like expression, |
no test coverage detected