os: optimize struct packing for _XtransConnInfo, _host, and auth

- _XtransConnInfo: pack transptr, priv, flags, fd, index, family, port,
  addr, peeraddr, and recv_fds into the first 64-byte cache line (0 holes!).
  Keeps hot connection I/O fields (transptr, priv, flags, fd) in Cacheline 0
  avoiding extra cache lines during request dispatching.
  Reduces total size from 96 to 80 bytes (-16 bytes).
- _host: group family, len, and requested adjacent to each other.
  Reduces size from 32 to 24 bytes (-25%).
- auth: group id and len adjacent to each other.
  Reduces size from 32 to 24 bytes (-25%).
This commit is contained in:
Herman Semenov 2026-09-29 04:04:14 +03:00 • committed by Enrico Weigelt
commit 13bfd52547
3 changed files with 6 additions and 6 deletions

View file

@ -112,18 +112,18 @@ struct _XtransConnFd {
struct _XtransConnInfo {
struct _Xtransport *transptr;
int index;
char *priv;
int flags;
int fd;
char *port;
int index;
int family;
char *port;
char *addr;
int addrlen;
char *peeraddr;
int peeraddrlen;
struct _XtransConnFd *recv_fds;
struct _XtransConnFd *send_fds;
int addrlen;
int peeraddrlen;
};
#define XTRANS_OPEN_COTS_CLIENT 1

View file

@ -215,9 +215,9 @@ static Bool NewHost(int /*family */ ,
typedef struct _host {
short family;
short len;
int requested;
unsigned char *addr;
struct _host *next;
int requested;
} HOST;
#define MakeHost(h,l) (h)=calloc(1, sizeof *(h)+(l));\

View file

@ -41,9 +41,9 @@ from The Open Group.
static struct auth {
struct auth *next;
unsigned short len;
char *data;
XID id;
unsigned short len;
} *mit_auth;
XID