[master] b6633c0 BINHEAP_NOIDX should come from the binheap implementation.

Poul-Henning Kamp phk at varnish-cache.org
Wed Feb 9 14:00:34 CET 2011


commit b6633c0b17e0bea9f0913b440e9ae2a5d320770e
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Feb 9 13:00:16 2011 +0000

    BINHEAP_NOIDX should come from the binheap implementation.
    
    Now it does.

diff --git a/bin/varnishd/cache_expire.c b/bin/varnishd/cache_expire.c
index e7eca76..32de4a3 100644
--- a/bin/varnishd/cache_expire.c
+++ b/bin/varnishd/cache_expire.c
@@ -57,13 +57,6 @@ static pthread_t exp_thread;
 static struct binheap *exp_heap;
 static struct lock exp_mtx;
 
-/*
- * This is a magic marker for the objects currently on the SIOP [look it up]
- * so that other users of the object will not stumble trying to change the
- * ttl or lru position.
- */
-#define BINHEAP_NOIDX 0		/* XXX: should be in binary_heap.h */
-
 /*--------------------------------------------------------------------
  * When & why does the timer fire for this object ?
  */
diff --git a/include/binary_heap.h b/include/binary_heap.h
index 869ebf9..d8a4475 100644
--- a/include/binary_heap.h
+++ b/include/binary_heap.h
@@ -79,3 +79,4 @@ void *binheap_root(const struct binheap *);
 	 * Return the root item
 	 */
 
+#define BINHEAP_NOIDX	0
diff --git a/lib/libvarnish/binary_heap.c b/lib/libvarnish/binary_heap.c
index 53ff738..125f7a2 100644
--- a/lib/libvarnish/binary_heap.c
+++ b/lib/libvarnish/binary_heap.c
@@ -351,7 +351,7 @@ binheap_delete(struct binheap *bh, unsigned idx)
 	assert(idx < bh->next);
 	assert(idx > 0);
 	assert(A(bh, idx) != NULL);
-	bh->update(bh->priv, A(bh, idx), 0);
+	bh->update(bh->priv, A(bh, idx), BINHEAP_NOIDX);
 	if (idx == --bh->next) {
 		A(bh, bh->next) = NULL;
 		return;



More information about the varnish-commit mailing list