]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: vars: remove the now unused var_names array
authorWilly Tarreau <w@1wt.eu>
Tue, 31 Aug 2021 07:00:16 +0000 (09:00 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 8 Sep 2021 13:09:22 +0000 (15:09 +0200)
This was the table of all variable names known to the haproxy process.
It's not used anymore.

src/vars.c

index 98e1cfec87d0648f6e8104d982973f9ebc32e15f..df76d980faa9086e4ca8eba35efe7d545902a941 100644 (file)
@@ -26,14 +26,6 @@ DECLARE_STATIC_POOL(var_pool, "vars", sizeof(struct var));
 /* list of variables for the process scope. */
 struct vars proc_vars THREAD_ALIGNED(64);
 
-/* This array contain all the names of all the HAProxy vars.
- * This permits to identify two variables name with
- * only one pointer. It permits to not using  strdup() for
- * each variable name used during the runtime.
- */
-static char **var_names = NULL;
-static int var_names_nb = 0;
-
 /* This array of int contains the system limits per context. */
 static unsigned int var_global_limit = 0;
 static unsigned int var_global_size = 0;
@@ -44,8 +36,6 @@ static unsigned int var_reqres_limit = 0;
 static unsigned int var_check_limit = 0;
 static uint64_t var_name_hash_seed = 0;
 
-__decl_rwlock(var_names_rwlock);
-
 /* returns the struct vars pointer for a session, stream and scope, or NULL if
  * it does not exist.
  */
@@ -1185,15 +1175,6 @@ static void vars_init()
 
 INITCALL0(STG_PREPARE, vars_init);
 
-static void vars_deinit()
-{
-       while (var_names_nb-- > 0)
-               free(var_names[var_names_nb]);
-       free(var_names);
-}
-
-REGISTER_POST_DEINIT(vars_deinit);
-
 static struct sample_fetch_kw_list sample_fetch_keywords = {ILH, {
 
        { "var", smp_fetch_var, ARG2(1,STR,STR), smp_check_var, SMP_T_STR, SMP_USE_CONST },