summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2019-02-08 17:02:23 +0100
committerFlorian Westphal <fw@strlen.de>2019-02-08 21:26:16 +0100
commite3f195777ee54c7a57aab932b64c6ecbd782f68f (patch)
treef1336d55e55529df44d01c47f8fefd0b844bdfa8 /include
parent72931553828af0ce85f0562b9ff8ec7f4d28e050 (diff)
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 <fw@strlen.de>
Diffstat (limited to 'include')
-rw-r--r--include/expression.h9
1 files changed, 4 insertions, 5 deletions
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);