2013-05-11 21:53:30 -04:00
|
|
|
namespace factor {
|
2009-10-07 16:48:09 -04:00
|
|
|
|
2013-05-11 21:53:30 -04:00
|
|
|
template <typename TargetGeneration, typename Policy>
|
|
|
|
struct copying_collector : collector<TargetGeneration, Policy> {
|
|
|
|
cell scan;
|
2009-10-07 16:48:09 -04:00
|
|
|
|
2013-05-12 23:20:43 -04:00
|
|
|
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
|
|
|
|
2013-05-11 21:53:30 -04:00
|
|
|
void cheneys_algorithm() {
|
|
|
|
while (scan && scan < this->target->here) {
|
|
|
|
this->trace_object((object*)scan);
|
|
|
|
scan = this->target->next_object_after(scan);
|
|
|
|
}
|
|
|
|
}
|
2009-10-07 16:48:09 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|