diff --git a/include/haproxy/vars.h b/include/haproxy/vars.h index b66a5d441..641fba274 100644 --- a/include/haproxy/vars.h +++ b/include/haproxy/vars.h @@ -35,7 +35,6 @@ struct arg; void vars_init_head(struct vars *vars, enum vars_scope scope); void var_accounting_diff(struct vars *vars, struct session *sess, struct stream *strm, int size); unsigned int var_clear(struct var *var, int force); -void vars_prune(struct vars *vars, struct session *sess, struct stream *strm); void vars_prune_per_sess(struct vars *vars); int var_set(const struct var_desc *desc, struct sample *smp, uint flags); int var_unset(const struct var_desc *desc, struct sample *smp); @@ -74,4 +73,19 @@ static inline void vars_rdunlock(struct vars *vars) HA_RWLOCK_RDUNLOCK(VARS_LOCK, &vars->rwlock); } +/* This function free all the memory used by all the variables + * in the list. + */ +static inline void vars_prune(struct vars *vars, struct session *sess, struct stream *strm) +{ + struct var *var, *tmp; + unsigned int size = 0; + + list_for_each_entry_safe(var, tmp, &vars->head, l) { + size += var_clear(var, 1); + } + + var_accounting_diff(vars, sess, strm, -size); +} + #endif diff --git a/src/vars.c b/src/vars.c index 772ae3402..f7d12e848 100644 --- a/src/vars.c +++ b/src/vars.c @@ -195,21 +195,6 @@ unsigned int var_clear(struct var *var, int force) return size; } -/* This function free all the memory used by all the variables - * in the list. - */ -void vars_prune(struct vars *vars, struct session *sess, struct stream *strm) -{ - struct var *var, *tmp; - unsigned int size = 0; - - list_for_each_entry_safe(var, tmp, &vars->head, l) { - size += var_clear(var, 1); - } - - var_accounting_diff(vars, sess, strm, -size); -} - /* This function frees all the memory used by all the session variables in the * list starting at . */