1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2014-09-11 10:34:09 +00:00
parent 51101947bb
commit c653db51b0
4 changed files with 24 additions and 1 deletions

View file

@ -1,3 +1,14 @@
Thu Sep 11 19:32:30 2014 Koichi Sasada <ko1@atdot.net>
* 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@atdot.net>
* gc.c (gc_mark_ptr): rename to gc_mark_set.

11
gc.c
View file

@ -3639,6 +3639,17 @@ rb_gc_mark_locations(const VALUE *start, const VALUE *end)
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 {

View file

@ -1077,6 +1077,7 @@ st_table *rb_st_copy(VALUE obj, struct st_table *orig_tbl);
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

2
vm.c
View file

@ -356,7 +356,7 @@ env_mark(void * const ptr)
/* 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);