Slide 18
Slide 18 text
struct RBasic {
/**
* Per-object flags. Each Ruby object 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
社内イベント資料より抜粋