diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-11 18:27:18 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-11 18:27:18 +0000 |
commit | 52c1331763d8b9b8d6362987e6f8847b65ed7f57 (patch) | |
tree | 428a90820733718a0a534bf25e8e626de5b2afb4 /class.c | |
parent | 86b2e9d090e9a614400d2ca6f0d24ee5698ad1dd (diff) | |
download | ruby-52c1331763d8b9b8d6362987e6f8847b65ed7f57.tar.gz |
* class.c, variable.c, gc.c (rb_class_tbl): removed.
* vm.c, vm_core.h (rb_vm_add_root_module): added to register as a
defined root module or class.
This guard helps mark miss from defined classes/modules they are
only refered from C's global variables in C-exts.
Basically, it is extension's bug.
Register to hash object VM has.
Marking a hash objects allows generational GC supports.
* gc.c (RGENGC_PRINT_TICK): disable (revert).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r-- | class.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -31,7 +31,9 @@ #include "internal.h" #include <ctype.h> -extern st_table *rb_class_tbl; +int rb_vm_add_root_module(ID id, VALUE module); + + #define id_attached id__attached__ void @@ -517,12 +519,10 @@ make_singleton_class(VALUE obj) static VALUE boot_defclass(const char *name, VALUE super) { - extern st_table *rb_class_tbl; VALUE obj = rb_class_boot(super); ID id = rb_intern(name); rb_name_class(obj, id); - st_add_direct(rb_class_tbl, id, obj); rb_const_set((rb_cObject ? rb_cObject : obj), id, obj); return obj; } @@ -643,7 +643,7 @@ rb_define_class(const char *name, VALUE super) rb_warn("no super class for `%s', Object assumed", name); } klass = rb_define_class_id(id, super); - st_add_direct(rb_class_tbl, id, klass); + rb_vm_add_root_module(id, klass); rb_name_class(klass, id); rb_const_set(rb_cObject, id, klass); rb_class_inherited(super, klass); @@ -754,7 +754,7 @@ rb_define_module(const char *name) rb_raise(rb_eTypeError, "%s is not a module", rb_obj_classname(module)); } module = rb_define_module_id(id); - st_add_direct(rb_class_tbl, id, module); + rb_vm_add_root_module(id, module); rb_const_set(rb_cObject, id, module); return module; |