vm: make some more ctors explicit just for kicks

db4
Slava Pestov 2009-10-24 23:02:58 -05:00
parent 62e718eaa9
commit fae27fb361
16 changed files with 22 additions and 21 deletions

View File

@ -6,7 +6,7 @@ struct aging_policy {
aging_space *aging;
tenured_space *tenured;
aging_policy(factor_vm *parent_) :
explicit aging_policy(factor_vm *parent_) :
parent(parent_),
aging(parent->data->aging),
tenured(parent->data->tenured) {}
@ -22,7 +22,7 @@ struct aging_policy {
};
struct aging_collector : copying_collector<aging_space,aging_policy> {
aging_collector(factor_vm *parent_);
explicit aging_collector(factor_vm *parent_);
};
}

View File

@ -4,7 +4,7 @@ namespace factor
struct aging_space : bump_allocator<object> {
object_start_map starts;
aging_space(cell size, cell start) :
explicit aging_space(cell size, cell start) :
bump_allocator<object>(size,start), starts(size,start) {}
object *allot(cell size)

View File

@ -8,7 +8,7 @@ template<typename Block> struct bump_allocator {
cell end;
cell size;
bump_allocator(cell size_, cell start_) :
explicit bump_allocator(cell size_, cell start_) :
here(start_), start(start_), end(start_ + size_), size(size_) {}
inline bool contains_p(Block *block)

View File

@ -88,6 +88,7 @@ struct word_updater {
factor_vm *parent;
explicit word_updater(factor_vm *parent_) : parent(parent_) {}
void operator()(code_block *compiled, cell size)
{
parent->update_word_references(compiled);
@ -107,7 +108,7 @@ to literals and other words. */
struct word_and_literal_code_heap_updater {
factor_vm *parent;
word_and_literal_code_heap_updater(factor_vm *parent_) : parent(parent_) {}
explicit word_and_literal_code_heap_updater(factor_vm *parent_) : parent(parent_) {}
void operator()(code_block *block, cell size)
{
@ -126,7 +127,7 @@ references to card and deck arrays. */
struct code_heap_relocator {
factor_vm *parent;
code_heap_relocator(factor_vm *parent_) : parent(parent_) {}
explicit code_heap_relocator(factor_vm *parent_) : parent(parent_) {}
void operator()(code_block *block, cell size)
{

View File

@ -7,7 +7,7 @@ struct dummy_unmarker {
struct simple_unmarker {
card unmask;
simple_unmarker(card unmask_) : unmask(unmask_) {}
explicit simple_unmarker(card unmask_) : unmask(unmask_) {}
void operator()(card *ptr) { *ptr &= ~unmask; }
};

View File

@ -290,7 +290,7 @@ struct code_block_printer {
factor_vm *parent;
cell reloc_size, literal_size;
code_block_printer(factor_vm *parent_) :
explicit code_block_printer(factor_vm *parent_) :
parent(parent_), reloc_size(0), literal_size(0) {}
void operator()(code_block *scan, cell size)

View File

@ -32,7 +32,7 @@ struct code_block_marker {
struct object_start_map_updater {
object_start_map *starts;
object_start_map_updater(object_start_map *starts_) : starts(starts_) {}
explicit object_start_map_updater(object_start_map *starts_) : starts(starts_) {}
void operator()(object *obj, cell size)
{

View File

@ -5,7 +5,7 @@ struct full_policy {
factor_vm *parent;
tenured_space *tenured;
full_policy(factor_vm *parent_) : parent(parent_), tenured(parent->data->tenured) {}
explicit full_policy(factor_vm *parent_) : parent(parent_), tenured(parent->data->tenured) {}
bool should_copy_p(object *untagged)
{
@ -27,7 +27,7 @@ struct full_policy {
struct full_collector : collector<tenured_space,full_policy> {
bool trace_contexts_p;
full_collector(factor_vm *parent_);
explicit full_collector(factor_vm *parent_);
};
}

View File

@ -215,7 +215,7 @@ struct code_block_fixupper {
factor_vm *parent;
cell data_relocation_base;
code_block_fixupper(factor_vm *parent_, cell data_relocation_base_) :
explicit code_block_fixupper(factor_vm *parent_, cell data_relocation_base_) :
parent(parent_), data_relocation_base(data_relocation_base_) { }
void operator()(code_block *compiled, cell size)

View File

@ -7,7 +7,7 @@ struct gc_root : public tagged<Type>
factor_vm *parent;
void push() { parent->gc_locals.push_back((cell)this); }
explicit gc_root(cell value_,factor_vm *vm) : tagged<Type>(value_),parent(vm) { push(); }
explicit gc_root(Type *value_, factor_vm *vm) : tagged<Type>(value_),parent(vm) { push(); }

View File

@ -4,7 +4,7 @@ namespace factor
struct nursery_policy {
factor_vm *parent;
nursery_policy(factor_vm *parent_) : parent(parent_) {}
explicit nursery_policy(factor_vm *parent_) : parent(parent_) {}
bool should_copy_p(object *obj)
{
@ -17,7 +17,7 @@ struct nursery_policy {
};
struct nursery_collector : copying_collector<aging_space,nursery_policy> {
nursery_collector(factor_vm *parent_);
explicit nursery_collector(factor_vm *parent_);
};
}

View File

@ -3,7 +3,7 @@ namespace factor
struct nursery_space : bump_allocator<object>
{
nursery_space(cell size, cell start) : bump_allocator<object>(size,start) {}
explicit nursery_space(cell size, cell start) : bump_allocator<object>(size,start) {}
};
}

View File

@ -8,7 +8,7 @@ struct object_start_map {
card *object_start_offsets;
card *object_start_offsets_end;
object_start_map(cell size_, cell start_);
explicit object_start_map(cell size_, cell start_);
~object_start_map();
cell first_object_in_card(cell card_index);

View File

@ -5,7 +5,7 @@ template<typename Visitor> struct slot_visitor {
factor_vm *parent;
Visitor visitor;
slot_visitor<Visitor>(factor_vm *parent_, Visitor visitor_) :
explicit slot_visitor<Visitor>(factor_vm *parent_, Visitor visitor_) :
parent(parent_), visitor(visitor_) {}
void visit_handle(cell *handle)

View File

@ -5,7 +5,7 @@ struct tenured_space : free_list_allocator<object> {
object_start_map starts;
std::vector<object *> mark_stack;
tenured_space(cell size, cell start) :
explicit tenured_space(cell size, cell start) :
free_list_allocator<object>(size,start), starts(size,start) {}
object *allot(cell size)

View File

@ -5,7 +5,7 @@ struct to_tenured_policy {
factor_vm *myvm;
tenured_space *tenured;
to_tenured_policy(factor_vm *myvm_) : myvm(myvm_), tenured(myvm->data->tenured) {}
explicit to_tenured_policy(factor_vm *myvm_) : myvm(myvm_), tenured(myvm->data->tenured) {}
bool should_copy_p(object *untagged)
{
@ -21,7 +21,7 @@ struct to_tenured_policy {
};
struct to_tenured_collector : collector<tenured_space,to_tenured_policy> {
to_tenured_collector(factor_vm *myvm_);
explicit to_tenured_collector(factor_vm *myvm_);
void tenure_reachable_objects();
};