summaryrefslogtreecommitdiff
path: root/conf/conf.h
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2023-04-27 18:20:49 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2023-04-27 18:41:01 +0200
commita8a64ca0fed41c78376b27880e934296bd3c3a7f (patch)
treeb07dce29bd01d67438438278bc8af89879faba12 /conf/conf.h
parent9b471e72d75c154f3b8c4fa134c7c9f1a55fe27f (diff)
Conf: Improve handling of keywords
For whatever reason, parser allocated a symbol for every parsed keyword in each scope. That wasted time and memory. The effect is worsened with recent changes allowing local scopes, so keywords often promote soft scopes (with no symbols) to real scopes. Do not allocate a symbol for a keyword. Take care of keywords that could be promoted to symbols (kw_sym) and do it explicitly.
Diffstat (limited to 'conf/conf.h')
-rw-r--r--conf/conf.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/conf/conf.h b/conf/conf.h
index cb47e7d0..d40f955e 100644
--- a/conf/conf.h
+++ b/conf/conf.h
@@ -191,6 +191,9 @@ struct symbol *cf_find_local_symbol(const struct config *cfg, const struct sym_s
static inline struct symbol *cf_find_symbol(const struct config *cfg, const byte *c)
{ return cf_find_local_symbol(cfg, cfg->root_scope, c); }
+struct keyword;
+struct symbol *cf_symbol_from_keyword(const struct keyword *kw);
+
struct symbol *cf_get_symbol(const byte *c);
struct symbol *cf_default_name(char *template, int *counter);
struct symbol *cf_localize_symbol(struct symbol *sym);