ruby-changes:13939
From: nobu <ko1@a...>
Date: Fri, 13 Nov 2009 10:01:51 +0900 (JST)
Subject: [ruby-changes:13939] Ruby:r25743 (mvm): * parse.y (Init_sym): use separate object space.
nobu 2009-11-13 09:58:34 +0900 (Fri, 13 Nov 2009) New Revision: 25743 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25743 Log: * parse.y (Init_sym): use separate object space. Modified files: branches/mvm/ChangeLog branches/mvm/gc.c branches/mvm/gc.h branches/mvm/parse.y Index: mvm/ChangeLog =================================================================== --- mvm/ChangeLog (revision 25742) +++ mvm/ChangeLog (revision 25743) @@ -1,3 +1,7 @@ +Fri Nov 13 09:58:31 2009 Nobuyoshi Nakada <nobu@r...> + + * parse.y (Init_sym): use separate object space. + Thu Nov 12 16:35:42 2009 Nobuyoshi Nakada <nobu@r...> * eval.c (ruby_vm_run): cleanup needed. Index: mvm/gc.c =================================================================== --- mvm/gc.c (revision 25742) +++ mvm/gc.c (revision 25743) @@ -1337,8 +1337,8 @@ } } -static void -gc_mark_locations(rb_objspace_t *objspace, VALUE *start, VALUE *end) +void +rb_objspace_mark_locations(rb_objspace_t *objspace, VALUE *start, VALUE *end) { long n; @@ -1350,10 +1350,10 @@ void rb_gc_mark_locations(VALUE *start, VALUE *end) { - gc_mark_locations(&rb_objspace, start, end); + rb_objspace_mark_locations(&rb_objspace, start, end); } -#define rb_gc_mark_locations(start, end) gc_mark_locations(objspace, start, end) +#define rb_gc_mark_locations(start, end) rb_objspace_mark_locations(objspace, start, end) struct mark_tbl_arg { rb_objspace_t *objspace; @@ -1485,6 +1485,12 @@ } void +rb_objspace_mark_tbl(rb_objspace_t *objspace, st_table *tbl) +{ + mark_tbl(objspace, tbl, 0); +} + +void rb_mark_tbl(st_table *tbl) { mark_tbl(&rb_objspace, tbl, 0); Index: mvm/gc.h =================================================================== --- mvm/gc.h (revision 25742) +++ mvm/gc.h (revision 25743) @@ -80,4 +80,8 @@ VALUE rb_objspace_gc_enable(struct rb_objspace *objspace); VALUE rb_newobj_from_heap(struct rb_objspace *objspace); +struct st_table; +void rb_objspace_mark_tbl(struct rb_objspace *objspace, struct st_table *tbl); +void rb_objspace_mark_locations(struct rb_objspace *objspace, VALUE *start, VALUE *end); + #endif /* RUBY_GC_H */ Index: mvm/parse.y =================================================================== --- mvm/parse.y (revision 25742) +++ mvm/parse.y (revision 25743) @@ -9324,7 +9324,8 @@ { ruby_native_thread_lock_initialize(&global_symbols.lock); ruby_native_thread_lock(&global_symbols.lock); - global_symbols.objspace = GET_VM()->objspace; + global_symbols.objspace = rb_objspace_alloc(); + rb_objspace_gc_disable(global_symbols.objspace); global_symbols.sym_id = st_init_table_with_size(&symhash, 1000); global_symbols.id_str = st_init_numtable_with_size(1000); Init_id(); @@ -9347,9 +9348,9 @@ rb_gc_mark_symbols(void) { #if 0 - rb_mark_tbl(global_symbols.id_str); - rb_gc_mark_locations(global_symbols.op_sym, - global_symbols.op_sym + tLAST_TOKEN); + rb_objspace_mark_tbl(global_symbols.objspace, global_symbols.id_str); + rb_objspace_mark_locations(global_symbols.objspace, global_symbols.op_sym, + global_symbols.op_sym + tLAST_TOKEN); #endif } #endif /* !RIPPER */ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/