зеркало из https://github.com/github/ruby.git
Add compaction notes for class/module creation C APIs
This commit is contained in:
Родитель
646131448e
Коммит
216e6605a4
8
class.c
8
class.c
|
@ -791,6 +791,7 @@ rb_define_class(const char *name, VALUE super)
|
||||||
*
|
*
|
||||||
* \note if a class named \a name is already defined and its superclass is
|
* \note if a class named \a name is already defined and its superclass is
|
||||||
* \a super, the function just returns the defined class.
|
* \a super, the function just returns the defined class.
|
||||||
|
* \note the compaction GC does not move classes returned by this function.
|
||||||
*/
|
*/
|
||||||
VALUE
|
VALUE
|
||||||
rb_define_class_under(VALUE outer, const char *name, VALUE super)
|
rb_define_class_under(VALUE outer, const char *name, VALUE super)
|
||||||
|
@ -814,6 +815,7 @@ rb_define_class_under(VALUE outer, const char *name, VALUE super)
|
||||||
*
|
*
|
||||||
* \note if a class named \a name is already defined and its superclass is
|
* \note if a class named \a name is already defined and its superclass is
|
||||||
* \a super, the function just returns the defined class.
|
* \a super, the function just returns the defined class.
|
||||||
|
* \note the compaction GC does not move classes returned by this function.
|
||||||
*/
|
*/
|
||||||
VALUE
|
VALUE
|
||||||
rb_define_class_id_under(VALUE outer, ID id, VALUE super)
|
rb_define_class_id_under(VALUE outer, ID id, VALUE super)
|
||||||
|
@ -866,6 +868,9 @@ rb_define_module_id(ID id)
|
||||||
return rb_module_new();
|
return rb_module_new();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \note the compaction GC does not move modules returned by this function.
|
||||||
|
*/
|
||||||
VALUE
|
VALUE
|
||||||
rb_define_module(const char *name)
|
rb_define_module(const char *name)
|
||||||
{
|
{
|
||||||
|
@ -890,6 +895,9 @@ rb_define_module(const char *name)
|
||||||
return module;
|
return module;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \note the compaction GC does not move modules returned by this function.
|
||||||
|
*/
|
||||||
VALUE
|
VALUE
|
||||||
rb_define_module_under(VALUE outer, const char *name)
|
rb_define_module_under(VALUE outer, const char *name)
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,6 +25,10 @@
|
||||||
|
|
||||||
RBIMPL_SYMBOL_EXPORT_BEGIN()
|
RBIMPL_SYMBOL_EXPORT_BEGIN()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GC compaction note: class and modules returned by these four functions
|
||||||
|
* do not move.
|
||||||
|
*/
|
||||||
VALUE rb_define_class(const char*,VALUE);
|
VALUE rb_define_class(const char*,VALUE);
|
||||||
VALUE rb_define_module(const char*);
|
VALUE rb_define_module(const char*);
|
||||||
VALUE rb_define_class_under(VALUE, const char*, VALUE);
|
VALUE rb_define_class_under(VALUE, const char*, VALUE);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче