diff options
author | Maria Matejka <mq@ucw.cz> | 2018-12-27 14:26:11 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2019-02-20 22:30:54 +0100 |
commit | 4c553c5a5b40c21ba67bd82455e79678b204cd07 (patch) | |
tree | 693d5744a125dc6dd6ed42124bf3a082cbf5503a /conf/confbase.Y | |
parent | 967b88d9388b3800efed45798542cd0b41f2b903 (diff) |
Filter refactoring: dropped the recursion from the interpreter
This is a major change of how the filters are interpreted. If everything
works how it should, it should not affect you unless you are hacking the
filters themselves.
Anyway, this change should make a huge improvement in the filter performance
as previous benchmarks showed that our major problem lies in the
recursion itself.
There are also some changes in nest and protocols, related mostly to
spreading const declarations throughout the whole BIRD and also to
refactored dynamic attribute definitions. The need of these came up
during the whole work and it is too difficult to split out these
not-so-related changes.
Diffstat (limited to 'conf/confbase.Y')
-rw-r--r-- | conf/confbase.Y | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/conf/confbase.Y b/conf/confbase.Y index 3d573e10..492ecd08 100644 --- a/conf/confbase.Y +++ b/conf/confbase.Y @@ -55,7 +55,6 @@ CF_DECLS struct f_tree *e; struct f_trie *trie; struct f_val v; - struct f_path_mask *h; struct password_item *p; struct rt_show_data *ra; struct sym_show_data *sd; @@ -124,14 +123,14 @@ conf: definition ; definition: DEFINE SYM '=' term ';' { struct f_val *val = cfg_alloc(sizeof(struct f_val)); - if (f_eval($4, cfg_mem, val) > F_RETURN) cf_error("Runtime error"); + if (f_eval(f_postfixify($4), cfg_mem, val) > F_RETURN) cf_error("Runtime error"); cf_define_symbol($2, SYM_CONSTANT | val->type, val); } ; expr: NUM - | '(' term ')' { $$ = f_eval_int($2); } + | '(' term ')' { $$ = f_eval_int(f_postfixify($2)); } | SYM { if ($1->class != (SYM_CONSTANT | T_INT)) cf_error("Number expected"); $$ = SYM_VAL($1).i; } |