VM: Refactor copying_collector.hpp to Factor style

db4
Erik Charlebois 2013-05-11 21:53:30 -04:00
parent 2a5126e49a
commit 0cf7feba0b
1 changed files with 14 additions and 15 deletions

View File

@ -1,17 +1,16 @@
namespace factor namespace factor {
{
template <typename TargetGeneration, typename Policy> template <typename TargetGeneration, typename Policy>
struct copying_collector : collector<TargetGeneration, Policy> { struct copying_collector : collector<TargetGeneration, Policy> {
cell scan; cell scan;
explicit copying_collector(factor_vm *parent_, TargetGeneration *target_, Policy policy_) : explicit copying_collector(factor_vm* parent_, TargetGeneration* target_,
collector<TargetGeneration,Policy>(parent_,target_,policy_), scan(target_->here) {} Policy policy_)
: collector<TargetGeneration, Policy>(parent_, target_, policy_),
scan(target_->here) {}
void cheneys_algorithm() void cheneys_algorithm() {
{ while (scan && scan < this->target->here) {
while(scan && scan < this->target->here)
{
this->trace_object((object*)scan); this->trace_object((object*)scan);
scan = this->target->next_object_after(scan); scan = this->target->next_object_after(scan);
} }