CLEANUP: fdtab: flatten the struct and merge the spec struct with the rest
The "spec" sub-struct was using 8 bytes for only 5 needed. There is no
reason to keep it as a struct, it doesn't bring any value. By flattening
it, we can merge the single byte with the next single byte, resulting in
an immediate saving of 4 bytes (20%). Interestingly, tests have shown a
steady performance gain of 0.6% after this change, which can possibly be
attributed to a more cache-line friendly struct.
diff --git a/include/types/fd.h b/include/types/fd.h
index f45b046..1ccb0eb 100644
--- a/include/types/fd.h
+++ b/include/types/fd.h
@@ -55,10 +55,8 @@
struct fdtab {
int (*iocb)(int fd); /* I/O handler, returns FD_WAIT_* */
void *owner; /* the connection or listener associated with this fd, NULL if closed */
- struct { /* used by pollers which support speculative polling */
- unsigned char e; /* read and write events status. 4 bits, may be merged into flags' lower bits */
- unsigned int s1; /* Position in spec list+1. 0=not in list. */
- } spec;
+ unsigned int spec_p; /* speculative polling: position in spec list+1. 0=not in list. */
+ unsigned char spec_e; /* speculative polling: read and write events status. 4 bits */
unsigned char ev; /* event seen in return of poll() : FD_POLL_* */
};