Permalink
Browse files

Save 4 bytes RAM per structure by reordering struct members

Structure size is 12 byte instead of 16 with GCC on x86,
probably also on others.
  • Loading branch information...
1 parent 55b78b5 commit 90897d2d0222d3cec24a0c2745b6b1440c692efa @martinwguy martinwguy committed Feb 26, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 inc/buf.h
View
@@ -22,9 +22,9 @@ enum
typedef struct
{
u8 logsize;
+ u8 logdsize;
volatile u16 wptr, rptr, count;
t_buf_data *buf;
- u8 logdsize;
} buf_desc;
// Buffer sizes (there are power of 2 to speed up modulo operations)

0 comments on commit 90897d2

Please sign in to comment.