[DOC] mention rb_define_alloc_func [ci skip]

This commit is contained in:
Nobuyoshi Nakada 2021-08-21 16:42:50 +09:00
parent e2b2b577b6
commit 8f755ad6c8
No known key found for this signature in database
GPG Key ID: 7CD2805BFA3770C6
2 changed files with 27 additions and 24 deletions

View File

@ -698,7 +698,8 @@ Cの世界で定義されたデータ(構造体)をRubyのオブジェクトと
このマクロの戻り値は生成されたオブジェクトを表すVALUE値です
klassはこのオブジェクトのクラスですklassは, Objectクラスか
ら派生し, 必ずrb_undef_alloc_func(klass)を呼び出してください.
ら派生し, 必ずrb_define_alloc_funcかrb_undef_alloc_funcを呼
び出してallocatorを設定してください
data_typeはこの構造体をRubyが管理するための情報を記述した
const rb_data_type_t型へのポインタです

View File

@ -657,8 +657,10 @@ with the next macro.
TypedData_Wrap_Struct() returns a created Ruby object as a VALUE.
The klass argument is the class for the object. It is recommended
that klass derives from rb_cObject.
The klass argument is the class for the object. The klass should
derive from rb_cObject, and the allocator must be set by calling
rb_define_alloc_func or rb_undef_alloc_func.
data_type is a pointer to a const rb_data_type_t which describes
how Ruby should manage the struct.