зеркало из https://github.com/github/ruby.git
Stop exposing FrozenCore in headers
Revert commit "Directly allocate FrozenCore as an ICLASS",
813a5f4fc4
.
This commit is contained in:
Родитель
b33e9f637d
Коммит
4634405f7c
10
class.c
10
class.c
|
@ -1128,16 +1128,10 @@ rb_define_module_id_under(VALUE outer, ID id)
|
|||
return module;
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_iclass_alloc(VALUE klass)
|
||||
{
|
||||
return class_alloc(T_ICLASS, klass);
|
||||
}
|
||||
|
||||
VALUE
|
||||
rb_include_class_new(VALUE module, VALUE super)
|
||||
{
|
||||
VALUE klass = rb_iclass_alloc(rb_cClass);
|
||||
VALUE klass = class_alloc(T_ICLASS, rb_cClass);
|
||||
|
||||
RCLASS_M_TBL(klass) = RCLASS_M_TBL(module);
|
||||
|
||||
|
@ -1414,7 +1408,7 @@ ensure_origin(VALUE klass)
|
|||
{
|
||||
VALUE origin = RCLASS_ORIGIN(klass);
|
||||
if (origin == klass) {
|
||||
origin = rb_iclass_alloc(klass);
|
||||
origin = class_alloc(T_ICLASS, klass);
|
||||
RCLASS_SET_SUPER(origin, RCLASS_SUPER(klass));
|
||||
RCLASS_SET_SUPER(klass, origin);
|
||||
RCLASS_SET_ORIGIN(klass, origin);
|
||||
|
|
|
@ -119,7 +119,6 @@ VALUE rb_module_s_alloc(VALUE klass);
|
|||
void rb_module_set_initialized(VALUE module);
|
||||
void rb_module_check_initializable(VALUE module);
|
||||
VALUE rb_make_metaclass(VALUE, VALUE);
|
||||
VALUE rb_iclass_alloc(VALUE klass);
|
||||
VALUE rb_include_class_new(VALUE, VALUE);
|
||||
void rb_class_foreach_subclass(VALUE klass, void (*f)(VALUE, VALUE), VALUE);
|
||||
void rb_class_detach_subclasses(VALUE);
|
||||
|
@ -206,7 +205,7 @@ RCLASS_SET_SUPER(VALUE klass, VALUE super)
|
|||
static inline void
|
||||
RCLASS_SET_CLASSPATH(VALUE klass, VALUE classpath, bool permanent)
|
||||
{
|
||||
assert(BUILTIN_TYPE(klass) == T_CLASS || BUILTIN_TYPE(klass) == T_MODULE || klass == rb_mRubyVMFrozenCore);
|
||||
assert(BUILTIN_TYPE(klass) == T_CLASS || BUILTIN_TYPE(klass) == T_MODULE);
|
||||
assert(classpath == 0 || BUILTIN_TYPE(classpath) == T_STRING);
|
||||
|
||||
RB_OBJ_WRITE(klass, &(RCLASS_EXT(klass)->classpath), classpath);
|
||||
|
|
5
vm.c
5
vm.c
|
@ -3664,6 +3664,7 @@ Init_VM(void)
|
|||
{
|
||||
VALUE opts;
|
||||
VALUE klass;
|
||||
VALUE fcore;
|
||||
|
||||
/*
|
||||
* Document-class: RubyVM
|
||||
|
@ -3689,8 +3690,9 @@ Init_VM(void)
|
|||
#endif
|
||||
|
||||
/* FrozenCore (hidden) */
|
||||
VALUE fcore = rb_mRubyVMFrozenCore = rb_iclass_alloc(rb_cBasicObject);
|
||||
fcore = rb_class_new(rb_cBasicObject);
|
||||
rb_set_class_path(fcore, rb_cRubyVM, "FrozenCore");
|
||||
RBASIC(fcore)->flags = T_ICLASS;
|
||||
klass = rb_singleton_class(fcore);
|
||||
rb_define_method_id(klass, id_core_set_method_alias, m_core_set_method_alias, 3);
|
||||
rb_define_method_id(klass, id_core_set_variable_alias, m_core_set_variable_alias, 2);
|
||||
|
@ -3709,6 +3711,7 @@ Init_VM(void)
|
|||
RBASIC_CLEAR_CLASS(klass);
|
||||
rb_obj_freeze(klass);
|
||||
rb_gc_register_mark_object(fcore);
|
||||
rb_mRubyVMFrozenCore = fcore;
|
||||
|
||||
/*
|
||||
* Document-class: Thread
|
||||
|
|
Загрузка…
Ссылка в новой задаче