diff options
author | Marius Kintel <marius@kintel.net> | 2012-01-06 18:10:33 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2012-01-09 23:01:50 (GMT) |
commit | fe3362faf825016606a8bcd60669c16965b0599c (patch) | |
tree | 1cfccc34acf462d9faefdfb8662c48cde878cbf9 /src/CGALEvaluator.cc | |
parent | c4695872392a6d1415752934be55c81de57de87e (diff) |
Started on cache size management: Let cache sizes be read from Preferences, measure cache sizes in bytes
Diffstat (limited to 'src/CGALEvaluator.cc')
-rw-r--r-- | src/CGALEvaluator.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/CGALEvaluator.cc b/src/CGALEvaluator.cc index 88d1f00..9528db6 100644 --- a/src/CGALEvaluator.cc +++ b/src/CGALEvaluator.cc @@ -42,6 +42,12 @@ CGAL_Nef_polyhedron CGALEvaluator::evaluateCGALMesh(const AbstractNode &node) if (!isCached(node)) { Traverser evaluate(*this, node, Traverser::PRE_AND_POSTFIX); evaluate.execute(); + // FIXME: If the root node didn't fit into the cache, the following assert + // will fail. We should handle this differently: + // 1) Return a NULL polyhedron, so the caller knows what happens + // 2) Return the polyhedron in a reference parameter and return a status code + // explicitly telling the caller what happened + // 3) Somehow ask the user to increase cache size and continue processing assert(isCached(node)); } return CGALCache::instance()->get(this->tree.getIdString(node)); @@ -354,6 +360,9 @@ void CGALEvaluator::addToParent(const State &state, const AbstractNode &node, co // Root node, insert into cache if (!isCached(node)) { CGALCache::instance()->insert(this->tree.getIdString(node), N); + // FIXME: If the root node didn't fit into the cache, the following assert + // will fail. See evaluateCGALMesh(const AbstractNode &node) + assert(isCached(node)); } } } |