[master] 473e58c Collapse two VTAILQ_ENTRY() in struct sess, saving 16 bytes.

Poul-Henning Kamp phk at varnish-cache.org
Mon Jan 2 11:02:17 CET 2012


commit 473e58c0b53edde3795bfc4637d2b71fb3166383
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Jan 2 10:01:47 2012 +0000

    Collapse two VTAILQ_ENTRY() in struct sess, saving 16 bytes.

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 42562b5..a15f272 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -636,6 +636,8 @@ struct sess {
 	struct worker		*wrk;
 	struct req		*req;
 
+	VTAILQ_ENTRY(sess)	list;
+
 	/* Session related fields ------------------------------------*/
 
 	int			fd;
@@ -651,11 +653,8 @@ struct sess {
 	char			addr[ADDR_BUFSIZE];
 	char			port[PORT_BUFSIZE];
 
-	VTAILQ_ENTRY(sess)	poollist;
 	struct acct		acct_ses;
 
-	VTAILQ_ENTRY(sess)	list;
-
 	/* Timestamps, all on TIM_real() timescale */
 	double			t_open;		/* fd accepted */
 	double			t_idle;		/* fd accepted or resp sent */
diff --git a/bin/varnishd/cache/cache_pool.c b/bin/varnishd/cache/cache_pool.c
index 9b0760c..84a6cfd 100644
--- a/bin/varnishd/cache/cache_pool.c
+++ b/bin/varnishd/cache/cache_pool.c
@@ -201,7 +201,7 @@ Pool_Work_Thread(void *priv, struct worker *wrk)
 		if (wrk->sp != NULL) {
 			/* Process queued requests, if any */
 			assert(pp->lqueue > 0);
-			VTAILQ_REMOVE(&pp->queue, wrk->sp, poollist);
+			VTAILQ_REMOVE(&pp->queue, wrk->sp, list);
 			wrk->do_what = pool_do_sess;
 			pp->lqueue--;
 		} else if (!VTAILQ_EMPTY(&pp->socks)) {
@@ -314,7 +314,7 @@ pool_queue(struct pool *pp, struct sess *sp)
 		return (-1);
 	}
 
-	VTAILQ_INSERT_TAIL(&pp->queue, sp, poollist);
+	VTAILQ_INSERT_TAIL(&pp->queue, sp, list);
 	pp->nqueued++;
 	pp->lqueue++;
 	Lck_Unlock(&pp->mtx);



More information about the varnish-commit mailing list