From 33bab281e27cf866e77fb3bba6e37f5a5edfef03 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 23 Aug 2026 22:08:16 +0200 Subject: Revert "optimize main state machine transitions with tail calls" For yet unknown reasons this does not improve performance on GCC 16 even though it also supports `__attribute__((musttail))`. As long as I do not understand why, I don't want to risk any unnecessary problems. I have reason to believe that the tail-call optimized version still has subtle bugs. See also the "tail-calls" branch. This reverts commit 2e097cec409182c3cb39b74489387480bf8a278f. --- src/stdio-commands.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/stdio-commands.c') diff --git a/src/stdio-commands.c b/src/stdio-commands.c index 94da3c7..34179c3 100644 --- a/src/stdio-commands.c +++ b/src/stdio-commands.c @@ -139,7 +139,7 @@ static teco_state_t * teco_state_print_decimal_input(teco_machine_main_t *ctx, gunichar chr, GError **error) { if (chr == '=') - TECO_RETURN(ctx, &teco_state_print_octal, error); + return &teco_state_print_octal; if (ctx->flags.mode == TECO_MODE_NORMAL) { if (G_LIKELY(!is_executing) && !teco_print(ctx, 10, error)) @@ -197,7 +197,7 @@ teco_state_print_octal_input(teco_machine_main_t *ctx, gunichar chr, GError **er return NULL; teco_expressions_pop_num(0); } - TECO_RETURN(ctx, &teco_state_start, error); + return &teco_state_start; } if (ctx->flags.mode == TECO_MODE_NORMAL) { -- cgit v1.2.3