From e3f195777ee54c7a57aab932b64c6ecbd782f68f Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Fri, 8 Feb 2019 17:02:23 +0100 Subject: src: expr: remove expr_ops from struct expr size of struct expr changes from 144 to 128 bytes on x86_64. This doesn't look like much, but large rulesets can have tens of thousands of expressions (each set element is represented by an expression). Signed-off-by: Florian Westphal --- src/rt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/rt.c') diff --git a/src/rt.c b/src/rt.c index b63284fb..090831fe 100644 --- a/src/rt.c +++ b/src/rt.c @@ -114,7 +114,7 @@ static void rt_expr_clone(struct expr *new, const struct expr *expr) new->rt.key = expr->rt.key; } -static const struct expr_ops rt_expr_ops = { +const struct expr_ops rt_expr_ops = { .type = EXPR_RT, .name = "rt", .print = rt_expr_print, @@ -130,10 +130,10 @@ struct expr *rt_expr_alloc(const struct location *loc, enum nft_rt_keys key, struct expr *expr; if (invalid && tmpl->invalid) - expr = expr_alloc(loc, &rt_expr_ops, &invalid_type, + expr = expr_alloc(loc, EXPR_RT, &invalid_type, tmpl->byteorder, 0); else - expr = expr_alloc(loc, &rt_expr_ops, tmpl->dtype, + expr = expr_alloc(loc, EXPR_RT, tmpl->dtype, tmpl->byteorder, tmpl->len); expr->rt.key = key; -- cgit v1.2.3