mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-26 01:59:57 +00:00
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:
parent
5c53650d27
commit
13bfd52547
3 changed files with 6 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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));\
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue