Skip to content

Commit 112d8cf

Browse files
Eric Dumazetdavem330
authored andcommitted
[FIB]: Reduce text size of net/ipv4/fib_trie.o
In struct tnode, we use two fields of 5 bits for 'pos' and 'bits'. Switching to plain 'unsigned char' (8 bits) take the same space because of compiler alignments, and reduce text size by 435 bytes on i386. On i386 : $ size net/ipv4/fib_trie.o.before_patch net/ipv4/fib_trie.o text data bss dec hex filename 13714 4 64 13782 35d6 net/ipv4/fib_trie.o.before 13279 4 64 13347 3423 net/ipv4/fib_trie.o Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Acked-by: Stephen Hemminger <stephen.hemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b9aed45 commit 112d8cf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎net/ipv4/fib_trie.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ struct leaf_info {
118118
struct tnode {
119119
t_key key;
120120
unsigned long parent;
121-
unsigned short pos:5; /* 2log(KEYLENGTH) bits needed */
122-
unsigned short bits:5; /* 2log(KEYLENGTH) bits needed */
121+
unsigned char pos; /* 2log(KEYLENGTH) bits needed */
122+
unsigned char bits; /* 2log(KEYLENGTH) bits needed */
123123
unsigned short full_children; /* KEYLENGTH bits needed */
124124
unsigned short empty_children; /* KEYLENGTH bits needed */
125125
struct rcu_head rcu;

0 commit comments

Comments
 (0)