
22 Jun
2013
22 Jun
'13
8:16 a.m.
On 06/17/2013 10:41 PM, Taylor Holliday wrote:
I like the idea. Some minor comments: In the Collect() function the sequence is a static local variable. You may consider making it a normal member variable (you have already declared the "collector" variable as static.) Apropos, you may consider using boost::call_once instead of using a Meyers singleton, because the latter is not thread-safe. In the mark phase you use an std::vector as a stack. It may be better to use std::stack. In the sweep phase you collect a new set and then assign it to the old. You should probably use one of these instead: _nodes.swap(newNodes); or if you are going for a C++11 only solution: _nodes = std::move(newNodes);