2009-10-07 16:48:09 -04:00
|
|
|
namespace factor
|
|
|
|
{
|
|
|
|
|
|
|
|
template<typename TargetGeneration, typename Policy>
|
|
|
|
struct copying_collector : collector<TargetGeneration,Policy> {
|
|
|
|
cell scan;
|
|
|
|
|
2009-10-26 23:08:35 -04:00
|
|
|
explicit copying_collector(factor_vm *parent_, TargetGeneration *target_, Policy policy_) :
|
|
|
|
collector<TargetGeneration,Policy>(parent_,target_,policy_), scan(target_->here) {}
|
2009-10-07 16:48:09 -04:00
|
|
|
|
2009-10-15 23:06:43 -04:00
|
|
|
void cheneys_algorithm()
|
2009-10-13 22:16:04 -04:00
|
|
|
{
|
2009-10-15 23:06:43 -04:00
|
|
|
while(scan && scan < this->target->here)
|
2009-10-13 22:16:04 -04:00
|
|
|
{
|
2009-11-02 04:25:39 -05:00
|
|
|
this->trace_object((object *)scan);
|
2009-10-20 23:20:49 -04:00
|
|
|
scan = this->target->next_object_after(scan);
|
2009-10-13 22:16:04 -04:00
|
|
|
}
|
|
|
|
}
|
2009-10-07 16:48:09 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|