summaryrefslogtreecommitdiff
path: root/src/expr/node_manager.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/expr/node_manager.h')
-rw-r--r--src/expr/node_manager.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/expr/node_manager.h b/src/expr/node_manager.h
index 32c492003..af771bd89 100644
--- a/src/expr/node_manager.h
+++ b/src/expr/node_manager.h
@@ -229,8 +229,7 @@ class NodeManager {
}
d_zombies.insert(nv);// FIXME multithreading
- if(!d_inReclaimZombies) {// FIXME multithreading
- // for now, collect eagerly. can add heuristic here later..
+ if(safeToReclaimZombies()) {
if(d_zombies.size() > 5000) {
reclaimZombies();
}
@@ -243,6 +242,11 @@ class NodeManager {
void reclaimZombies();
/**
+ * It is safe to collect zombies.
+ */
+ bool safeToReclaimZombies() const;
+
+ /**
* This template gives a mechanism to stack-allocate a NodeValue
* with enough space for N children (where N is a compile-time
* constant). You use it like this:
@@ -860,6 +864,15 @@ public:
*/
static inline TypeNode fromType(Type t);
+ /** Reclaim zombies while there are more than k nodes in the pool (if possible).*/
+ void reclaimZombiesUntil(uint32_t k);
+
+ /** Reclaims all zombies (if possible).*/
+ void reclaimAllZombies();
+
+ /** Size of the node pool. */
+ size_t poolSize() const;
+
/** Deletes a list of attributes from the NM's AttributeManager.*/
void deleteAttributes(const std::vector< const expr::attr::AttributeUniqueId* >& ids);
@@ -871,7 +884,6 @@ public:
* any published code!
*/
void debugHook(int debugFlag);
-
};/* class NodeManager */
/**
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback