diff options
author | Morgan Deters <mdeters@gmail.com> | 2010-03-12 23:52:14 +0000 |
---|---|---|
committer | Morgan Deters <mdeters@gmail.com> | 2010-03-12 23:52:14 +0000 |
commit | c8e9b1d6422b56476a2efb3fbaf19bce66de4c2b (patch) | |
tree | aa2b6400b7a5663599eff687310c509156ca788d /src/expr/node_manager.cpp | |
parent | 856567b63c56b238db8a5bb84ad0da7990c1f1eb (diff) |
* src/context/cdmap.h: rename orderedIterator to iterator, do away
with old iterator (closes bug #47).
* src/context/cdset.h: implemented.
* src/expr/node_builder.h: fixed all the strict-aliasing warnings.
* Remove Node::hash() and Expr::hash() (they had been aliases for
getId()). There's now a NodeValue::internalHash(), for internal
expr package purposes only, that doesn't depend on the ID. That's
the only hashing of Nodes or Exprs.
* Automake-quiet generation of kind.h, theoryof_table.h, and CVC and
SMT parsers.
* various minor code cleanups.
Diffstat (limited to 'src/expr/node_manager.cpp')
-rw-r--r-- | src/expr/node_manager.cpp | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/src/expr/node_manager.cpp b/src/expr/node_manager.cpp index 98171cb2e..7be593575 100644 --- a/src/expr/node_manager.cpp +++ b/src/expr/node_manager.cpp @@ -52,24 +52,6 @@ struct Reclaim { } }; -/** - * Reclaim a particular zombie. - */ -void NodeManager::reclaimZombie(expr::NodeValue* nv) { - Debug("gc") << "deleting node value " << nv - << " [" << nv->d_id << "]: " << nv->toString() << "\n"; - - if(nv->getKind() != kind::VARIABLE) { - poolRemove(nv); - } - - d_attrManager.deleteAllAttributes(nv); - - // dtor decr's ref counts of children - // FIXME: NOT ACTUALLY GARBAGE COLLECTING YET (DUE TO ISSUES WITH - // CDMAPs (?) ) delete nv; -} - void NodeManager::reclaimZombies() { // FIXME multithreading @@ -102,9 +84,25 @@ void NodeManager::reclaimZombies() { for(vector<NodeValue*>::iterator i = zombies.begin(); i != zombies.end(); ++i) { + NodeValue* nv = *i; + // collect ONLY IF still zero if((*i)->d_rc == 0) { - reclaimZombie(*i); + Debug("gc") << "deleting node value " << nv + << " [" << nv->d_id << "]: " << nv->toString() << "\n"; + + // remove from the pool + if(nv->getKind() != kind::VARIABLE) { + poolRemove(nv); + } + + // remove attributes + d_attrManager.deleteAllAttributes(nv); + + // decr ref counts of children + nv->decrRefCounts(); + //free(nv); +#warning NOT FREEING NODEVALUES } } } |