shithub: mc

Download patch

ref: cef9f9cc57105139c4157fdfb14036c724271271
parent: a3a707822d301c6c1e3cfd164c35e67463406397
author: Ori Bernstein <[email protected]>
date: Tue Feb 5 19:42:58 EST 2013

Document decdegree()'s subtlety.

    It's tricky, the way that we use worklists as sets, but
    only here.

--- a/6/ra.c
+++ b/6/ra.c
@@ -556,6 +556,18 @@
         enablemove(s, m);
         for (n = 0; adjiter(s, m, &n); n++)
             enablemove(s, n);
+
+        /* Subtle:
+         *
+         * If this code is being called from coalesce(),
+         * then the degree could have been bumped up only
+         * temporarily. This means that the node can already
+         * be on wlfreeze or wlsimp.
+         *
+         * Therefore, if we don't find it on wlspill, we assert
+         * that the node is already on the list that we'd be
+         * moving it to.
+         */
         found = wlhas(s->wlspill, s->nwlspill, m, &idx);
         if (found)
             ldel(&s->wlspill, &s->nwlspill, idx);