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 --- include/expression.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'include/expression.h') diff --git a/include/expression.h b/include/expression.h index 2450bc90..18563325 100644 --- a/include/expression.h +++ b/include/expression.h @@ -219,12 +219,11 @@ struct expr { unsigned int flags; const struct datatype *dtype; - enum byteorder byteorder; + enum byteorder byteorder:8; enum expr_types etype:8; + enum ops op:8; unsigned int len; - const struct expr_ops *ops; - enum ops op; union { struct { /* EXPR_SYMBOL */ @@ -354,7 +353,7 @@ struct expr { }; extern struct expr *expr_alloc(const struct location *loc, - const struct expr_ops *ops, + enum expr_types etype, const struct datatype *dtype, enum byteorder byteorder, unsigned int len); extern struct expr *expr_clone(const struct expr *expr); @@ -441,7 +440,7 @@ extern struct expr *range_expr_alloc(const struct location *loc, struct expr *low, struct expr *high); extern struct expr *compound_expr_alloc(const struct location *loc, - const struct expr_ops *ops); + enum expr_types etypes); extern void compound_expr_add(struct expr *compound, struct expr *expr); extern void compound_expr_remove(struct expr *compound, struct expr *expr); extern void list_expr_sort(struct list_head *head); -- cgit v1.2.3