pike.git / lib / modules / ADT.pmod / TreeScheduler.pike

version» Context lines:

pike.git/lib/modules/ADT.pmod/TreeScheduler.pike:245:    c->weight *= weight/children_weight;    parent->children_weight += c->weight;    }    children->set_depth(parent->depth + 1);    children = ({});    }    parent->children_weight -= weight;    parent->children->update_quanta();    }    -  protected void destroy() +  protected void _destruct()    {    if (parent) {    detach();    } else {    // Already detached, or we are the root.    foreach(children, Consumer c) {    c->parent = UNDEFINED;    c->set_depth(depth);    }    }
pike.git/lib/modules/ADT.pmod/TreeScheduler.pike:309:    while (child = todo->pop()) {    buf->sprintf(" %*s%O\n", child->depth * 2, "", child);    foreach(reverse(child->children), Consumer cc) {    todo->push(cc);    }    }    buf->add(")");    return (string)buf;   }    - protected void destroy() + protected void _destruct()   {    // Zap the circular references in the dependency tree.    .Stack todo = .Stack();    todo->push(0); // End sentinel.    todo->push(root);    root = UNDEFINED;    Consumer child;    while (child = todo->pop()) {    foreach(child->children, Consumer cc) {    todo->push(cc);    }    child->children = ({});    child->parent = UNDEFINED;    destruct(child);    }   }