diff --git a/core/generic/generic-tests.factor b/core/generic/generic-tests.factor index f5c2018e60..5a98173a89 100755 --- a/core/generic/generic-tests.factor +++ b/core/generic/generic-tests.factor @@ -3,7 +3,8 @@ classes.tuple classes.union compiler.units continuations definitions eval generic generic.math generic.standard hashtables io io.streams.string kernel layouts math math.order namespaces parser prettyprint quotations sequences sorting -strings tools.test vectors words generic.single ; +strings tools.test vectors words generic.single +compiler.crossref ; IN: generic.tests GENERIC: foobar ( x -- y ) diff --git a/core/words/words-tests.factor b/core/words/words-tests.factor index b9d6e80630..fec9c14830 100755 --- a/core/words/words-tests.factor +++ b/core/words/words-tests.factor @@ -1,7 +1,7 @@ USING: arrays generic assocs kernel math namespaces sequences tools.test words definitions parser quotations vocabs continuations classes.tuple compiler.units -io.streams.string accessors eval words.symbol ; +io.streams.string accessors eval words.symbol grouping ; IN: words.tests [ 4 ] [ @@ -121,7 +121,7 @@ DEFER: x [ { } ] [ all-words [ - "compiled-uses" word-prop + "compiled-uses" word-prop 2 keys [ "forgotten" word-prop ] filter ] map harvest ] unit-test diff --git a/vm/contexts.cpp b/vm/contexts.cpp index 16b882f2cc..f5fac1119e 100644 --- a/vm/contexts.cpp +++ b/vm/contexts.cpp @@ -3,6 +3,20 @@ namespace factor { +context::context(cell ds_size, cell rs_size) : + callstack_top(NULL), + callstack_bottom(NULL), + datastack(0), + retainstack(0), + datastack_save(0), + retainstack_save(0), + magic_frame(NULL), + datastack_region(new segment(ds_size,false)), + retainstack_region(new segment(rs_size,false)), + catchstack_save(0), + current_callback_save(0), + next(NULL) {} + void factor_vm::reset_datastack() { ds = ds_bot - sizeof(cell); @@ -42,11 +56,7 @@ context *factor_vm::alloc_context() unused_contexts = unused_contexts->next; } else - { - new_context = new context; - new_context->datastack_region = new segment(ds_size,false); - new_context->retainstack_region = new segment(rs_size,false); - } + new_context = new context(ds_size,rs_size); return new_context; } diff --git a/vm/contexts.hpp b/vm/contexts.hpp index aa6f9ec8ce..ddbae5de78 100644 --- a/vm/contexts.hpp +++ b/vm/contexts.hpp @@ -46,6 +46,8 @@ struct context { cell current_callback_save; context *next; + + context(cell ds_size, cell rs_size); }; #define ds_bot (ctx->datastack_region->start)