зеркало из https://github.com/github/ruby.git
Move return value of rb_gc_impl_config_set to gc.c
This commit is contained in:
Родитель
ebbb093094
Коммит
3d8fe462df
8
gc.c
8
gc.c
|
@ -588,7 +588,7 @@ typedef struct gc_function_map {
|
|||
void (*gc_disable)(void *objspace_ptr, bool finish_current_gc);
|
||||
bool (*gc_enabled_p)(void *objspace_ptr);
|
||||
VALUE (*config_get)(void *objpace_ptr);
|
||||
VALUE (*config_set)(void *objspace_ptr, VALUE hash);
|
||||
void (*config_set)(void *objspace_ptr, VALUE hash);
|
||||
void (*stress_set)(void *objspace_ptr, VALUE flag);
|
||||
VALUE (*stress_get)(void *objspace_ptr);
|
||||
// Object allocation
|
||||
|
@ -3432,7 +3432,11 @@ gc_config_get(rb_execution_context_t *ec, VALUE self)
|
|||
static VALUE
|
||||
gc_config_set(rb_execution_context_t *ec, VALUE self, VALUE hash)
|
||||
{
|
||||
return rb_gc_impl_config_set(rb_gc_get_objspace(), hash);
|
||||
void *objspace = rb_gc_get_objspace();
|
||||
|
||||
rb_gc_impl_config_set(objspace, hash);
|
||||
|
||||
return rb_gc_impl_config_get(objspace);
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
|
|
@ -7718,17 +7718,16 @@ gc_config_set_key(st_data_t key, st_data_t value, st_data_t data)
|
|||
return ST_CONTINUE;
|
||||
}
|
||||
|
||||
VALUE
|
||||
void
|
||||
rb_gc_impl_config_set(void *objspace_ptr, VALUE hash)
|
||||
{
|
||||
rb_objspace_t *objspace = objspace_ptr;
|
||||
|
||||
if(!RB_TYPE_P(hash, T_HASH)) {
|
||||
if (!RB_TYPE_P(hash, T_HASH)) {
|
||||
rb_raise(rb_eArgError, "expected keyword arguments");
|
||||
}
|
||||
|
||||
rb_hash_stlike_foreach(hash, gc_config_set_key, (st_data_t)objspace);
|
||||
return rb_gc_impl_config_get(objspace_ptr);
|
||||
}
|
||||
|
||||
VALUE
|
||||
|
|
|
@ -45,7 +45,7 @@ GC_IMPL_FN bool rb_gc_impl_gc_enabled_p(void *objspace_ptr);
|
|||
GC_IMPL_FN void rb_gc_impl_stress_set(void *objspace_ptr, VALUE flag);
|
||||
GC_IMPL_FN VALUE rb_gc_impl_stress_get(void *objspace_ptr);
|
||||
GC_IMPL_FN VALUE rb_gc_impl_config_get(void *objspace_ptr);
|
||||
GC_IMPL_FN VALUE rb_gc_impl_config_set(void *objspace_ptr, VALUE hash);
|
||||
GC_IMPL_FN void rb_gc_impl_config_set(void *objspace_ptr, VALUE hash);
|
||||
// Object allocation
|
||||
GC_IMPL_FN VALUE rb_gc_impl_new_obj(void *objspace_ptr, void *cache_ptr, VALUE klass, VALUE flags, VALUE v1, VALUE v2, VALUE v3, bool wb_protected, size_t alloc_size);
|
||||
GC_IMPL_FN size_t rb_gc_impl_obj_slot_size(VALUE obj);
|
||||
|
|
Загрузка…
Ссылка в новой задаче