ruby-changes:35451
From: ko1 <ko1@a...>
Date: Thu, 11 Sep 2014 19:34:20 +0900 (JST)
Subject: [ruby-changes:35451] ko1:r47533 (trunk): * gc.c (rb_gc_mark_values): added.
ko1 2014-09-11 19:34:09 +0900 (Thu, 11 Sep 2014) New Revision: 47533 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47533 Log: * gc.c (rb_gc_mark_values): added. This function is similar to rb_gc_mark_locations(), but not conservertive. * internal.h: ditto. * vm.c (env_mark): use rb_gc_mark_values() because env values should be Ruby VALUEs. Modified files: trunk/ChangeLog trunk/gc.c trunk/internal.h trunk/vm.c Index: ChangeLog =================================================================== --- ChangeLog (revision 47532) +++ ChangeLog (revision 47533) @@ -1,3 +1,14 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Sep 11 19:32:30 2014 Koichi Sasada <ko1@a...> + + * gc.c (rb_gc_mark_values): added. + This function is similar to rb_gc_mark_locations(), but not + conservertive. + + * internal.h: ditto. + + * vm.c (env_mark): use rb_gc_mark_values() because env values should + be Ruby VALUEs. + Thu Sep 11 19:16:39 2014 Koichi Sasada <ko1@a...> * gc.c (gc_mark_ptr): rename to gc_mark_set. Index: gc.c =================================================================== --- gc.c (revision 47532) +++ gc.c (revision 47533) @@ -3639,6 +3639,17 @@ rb_gc_mark_locations(const VALUE *start, https://github.com/ruby/ruby/blob/trunk/gc.c#L3639 gc_mark_locations(&rb_objspace, start, end); } +void +rb_gc_mark_values(long n, const VALUE *values) +{ + rb_objspace_t *objspace = &rb_objspace; + long i; + + for (i=0; i<n; i++) { + gc_mark(objspace, values[i]); + } +} + #define rb_gc_mark_locations(start, end) gc_mark_locations(objspace, (start), (end)) struct mark_tbl_arg { Index: internal.h =================================================================== --- internal.h (revision 47532) +++ internal.h (revision 47533) @@ -1077,6 +1077,7 @@ st_table *rb_st_copy(VALUE obj, struct s https://github.com/ruby/ruby/blob/trunk/internal.h#L1077 size_t rb_obj_memsize_of(VALUE); #define RB_OBJ_GC_FLAGS_MAX 5 size_t rb_obj_gc_flags(VALUE, ID[], size_t); +void rb_gc_mark_values(long n, const VALUE *values); RUBY_SYMBOL_EXPORT_END Index: vm.c =================================================================== --- vm.c (revision 47532) +++ vm.c (revision 47533) @@ -356,7 +356,7 @@ env_mark(void * const ptr) https://github.com/ruby/ruby/blob/trunk/vm.c#L356 /* TODO: should mark more restricted range */ RUBY_GC_INFO("env->env\n"); - rb_gc_mark_locations(env->env, env->env + env->env_size); + rb_gc_mark_values((long)env->env_size, env->env); RUBY_GC_INFO("env->prev_envval\n"); RUBY_MARK_UNLESS_NULL(env->prev_envval); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/