r269 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Thu Jun 29 21:06:44 CEST 2006


Author: phk
Date: 2006-06-29 21:06:44 +0200 (Thu, 29 Jun 2006)
New Revision: 269

Modified:
   trunk/varnish-cache/bin/varnishd/cache.h
   trunk/varnish-cache/bin/varnishd/cache_expire.c
Log:
Track objects heap-position


Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h	2006-06-29 17:09:24 UTC (rev 268)
+++ trunk/varnish-cache/bin/varnishd/cache.h	2006-06-29 19:06:44 UTC (rev 269)
@@ -70,6 +70,7 @@
 	struct objhead		*objhead;
 	pthread_cond_t		cv;
 
+	unsigned		heap_idx;
 	unsigned		ban_seq;
 
 	unsigned		valid;

Modified: trunk/varnish-cache/bin/varnishd/cache_expire.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_expire.c	2006-06-29 17:09:24 UTC (rev 268)
+++ trunk/varnish-cache/bin/varnishd/cache_expire.c	2006-06-29 19:06:44 UTC (rev 269)
@@ -115,6 +115,14 @@
 	return (aa->ttl < bb->ttl);
 }
 
+static void
+object_update(void *priv, void *p, unsigned u)
+{
+	struct object *o = p;
+
+	o->heap_idx = u;
+}
+
 /*--------------------------------------------------------------------*/
 
 void
@@ -124,6 +132,6 @@
 	AZ(pthread_mutex_init(&exp_mtx, NULL));
 	AZ(pthread_create(&exp_thread, NULL, exp_prefetch, NULL));
 	AZ(pthread_create(&exp_thread, NULL, exp_hangman, NULL));
-	exp_heap = binheap_new(NULL, object_cmp, NULL);
+	exp_heap = binheap_new(NULL, object_cmp, object_update);
 	assert(exp_heap != NULL);
 }




More information about the varnish-commit mailing list