r5584 - trunk/varnish-cache/bin/varnishd
phk at varnish-cache.org
phk at varnish-cache.org
Mon Nov 22 11:28:32 CET 2010
Author: phk
Date: 2010-11-22 11:28:32 +0100 (Mon, 22 Nov 2010)
New Revision: 5584
Modified:
trunk/varnish-cache/bin/varnishd/cache_expire.c
trunk/varnish-cache/bin/varnishd/cache_hash.c
Log:
Make comments reflect reality
Modified: trunk/varnish-cache/bin/varnishd/cache_expire.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_expire.c 2010-11-22 10:04:55 UTC (rev 5583)
+++ trunk/varnish-cache/bin/varnishd/cache_expire.c 2010-11-22 10:28:32 UTC (rev 5584)
@@ -33,7 +33,7 @@
*
* Any object on the LRU is also on the binheap and vice versa.
*
- * We hold one object reference for both data structures.
+ * We hold a single object reference for both data structures.
*
*/
@@ -90,8 +90,7 @@
/*--------------------------------------------------------------------
* Object has been added to cache, record in lru & binheap.
*
- * We grab a reference to the object, which will keep it around until
- * we decide its time to let it go.
+ * The objcore comes with a reference, which we inherit.
*/
void
@@ -295,7 +294,7 @@
}
/*--------------------------------------------------------------------
- * Attempt to make space by nuking, the oldest object on the LRU list
+ * Attempt to make space by nuking the oldest object on the LRU list
* which isn't in use.
* Returns: 1: did, 0: didn't, -1: can't
*/
@@ -306,16 +305,7 @@
struct objcore *oc;
struct object *o;
- /*
- * Find the first currently unused object on the LRU.
- *
- * Ideally we would have the refcnt in the objcore so we object does
- * not need to get paged in for this check, but it does not pay off
- * the complexity: The chances of an object being in front of the LRU,
- * with active references, likely means that it is already in core. An
- * object with no active references will be prodded further anyway.
- *
- */
+ /* Find the first currently unused object on the LRU. */
Lck_Lock(&exp_mtx);
VLIST_FOREACH(oc, &lru->lru_head, lru_list) {
if (oc == &lru->senteniel) {
Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_hash.c 2010-11-22 10:04:55 UTC (rev 5583)
+++ trunk/varnish-cache/bin/varnishd/cache_hash.c 2010-11-22 10:28:32 UTC (rev 5584)
@@ -240,6 +240,7 @@
/*---------------------------------------------------------------------
* Insert an object which magically appears out of nowhere or, more likely,
* comes off some persistent storage device.
+ * Return it with a reference held.
*/
struct objcore *
More information about the varnish-commit
mailing list