linux_inet_diag: better align listener_stats struct
authorEric Wong <normalperson@yhbt.net>
Sat, 20 Apr 2013 22:59:32 +0000 (20 22:59 +0000)
committerEric Wong <normalperson@yhbt.net>
Sat, 20 Apr 2013 22:59:32 +0000 (20 22:59 +0000)
Using an extra 4 bytes for the listener_stats should not
significantly increase space usage, and it has the side benefit
of making our code slightly smaller.

$ ~/linux/scripts/bloat-o-meter before.so after.so
add/remove: 0/0 grow/shrink: 1/2 up/down: 14/-32 (-18)
function                                     old     new   delta
tcp_stats                                    392     406     +14
st_to_hash                                   195     187      -8
diag                                         763     739     -24

ext/raindrops/linux_inet_diag.c

index d94dafd..dcf7bc2 100644 (file)
@@ -70,8 +70,8 @@ static ID id_new;
 
 struct listen_stats {
        uint32_t active;
-       uint32_t listener_p:1;
-       uint32_t queued:31;
+       uint32_t queued;
+       uint32_t listener_p;
 };
 
 #define OPLEN (sizeof(struct inet_diag_bc_op) + \