1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Conf: Replace keyword and symbol hash table with generic hash table.

The old hash table had fixed size, which makes it slow for config files
with large number of symbols and symbol lookups. The new one is growing
according to needs.
This commit is contained in:
Ondrej Zajicek (work)
2017-05-25 23:30:39 +02:00
parent c72b660b74
commit b7761af34d
4 changed files with 93 additions and 117 deletions

View File

@@ -46,22 +46,24 @@ cmd_show_status(void)
void
cmd_show_symbols(struct sym_show_data *sd)
{
int pos = 0;
struct symbol *sym = sd->sym;
if (sym)
cli_msg(1010, "%-8s\t%s", sym->name, cf_symbol_class_name(sym));
if (sd->sym)
cli_msg(1010, "%-8s\t%s", sd->sym->name, cf_symbol_class_name(sd->sym));
else
{
HASH_WALK(config->sym_hash, next, sym)
{
while (sym = cf_walk_symbols(config, sym, &pos))
{
if (sd->type && (sym->class != sd->type))
continue;
if (!sym->scope->active)
continue;
cli_msg(-1010, "%-8s\t%s", sym->name, cf_symbol_class_name(sym));
}
cli_msg(0, "");
if (sd->type && (sym->class != sd->type))
continue;
cli_msg(-1010, "%-8s\t%s", sym->name, cf_symbol_class_name(sym));
}
HASH_WALK_END;
cli_msg(0, "");
}
}
static void