*/ struct RBasic basic; /** Object's specific fields. */ union { struct { VALUE *ivptr; struct rb_id_table *iv_index_tbl; } heap; /* Embedded instance variables. When an object is small enough, it * uses this area to store the instance variables. */ VALUE ary[1]; } as; }; Ruby Object (RObject型) https://github.com/ruby/ruby/blob/master/include/ruby/internal/core/robject. h Cソース (robject.h) RBasic VALUE *ivptr struct rb_id_table *iv_index_tbl; RObject 社内イベント資料より抜粋
*/ struct RBasic basic; /** Object's specific fields. */ union { struct { VALUE *ivptr; struct rb_id_table *iv_index_tbl; } heap; /* Embedded instance variables. When an object is small enough, it * uses this area to store the instance variables. */ VALUE ary[1]; } as; }; Ruby Object (RObject型) https://github.com/ruby/ruby/blob/master/include/ruby/internal/core/robject. h Cソース (robject.h) Struct RBasic VALUE *ivptr struct rb_id_table *iv_index_tbl; RObject 社内イベント資料より抜粋
has its own characteristics apart * from its class. For instance, whether an object is frozen or not is not * controlled by its class. This is where such properties are stored. * * @see enum ::ruby_fl_type * * @note This is ::VALUE rather than an enum for alignment purposes. Back * in the 1990s there were no such thing like `_Alignas` in C. */ VALUE flags; /** * Class of an object. Every object has its class. Also, everything is an * object in Ruby. This means classes are also objects. Classes have * their own classes, classes of classes have their classes too, and it * recursively continues forever. * * Also note the `const` qualifier. In Ruby, an object cannot "change" its * class. */ const VALUE klass; }; Ruby Object 共通データ (RBasic 型) https://github.com/ruby/ruby/blob/master/include/ruby/internal/core/robject. Cソース (rbasic.h) VALUE *ivptr struct rb_id_table *iv_index_tbl; RObject struct RBasic VALUE flags VALUE klass 社内イベント資料より抜粋
has its own characteristics apart * from its class. For instance, whether an object is frozen or not is not * controlled by its class. This is where such properties are stored. * * @see enum ::ruby_fl_type * * @note This is ::VALUE rather than an enum for alignment purposes. Back * in the 1990s there were no such thing like `_Alignas` in C. */ VALUE flags; /** * Class of an object. Every object has its class. Also, everything is an * object in Ruby. This means classes are also objects. Classes have * their own classes, classes of classes have their classes too, and it * recursively continues forever. * * Also note the `const` qualifier. In Ruby, an object cannot "change" its * class. */ const VALUE klass; }; Ruby Object 共通データ (RBasic 型) https://github.com/ruby/ruby/blob/master/include/ruby/internal/core/robject. Cソース (rbasic.h) VALUE *ivptr struct rb_id_table *iv_index_tbl; RObject struct RBasic VALUE flags VALUE klass 社内イベント資料より抜粋