Ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e0ba6b95ab71a441357ed5484e33498)
Data Fields
RObject Struct Reference

Ruby's ordinal objects. More...

#include <robject.h>

Data Fields

struct RBasic basic
 Basic part, including flags and class. More...
 
union {
   struct {
      uint32_t   numiv
 
      VALUE *   ivptr
 
      struct st_table *   iv_index_tbl
 
   }   heap
 
   VALUE   ary [ROBJECT_EMBED_LEN_MAX]
 
as
 
union {
   struct {
      uint32_t   numiv
 Number of instance variables. More...
 
      VALUE *   ivptr
 Pointer to a C array that holds instance variables. More...
 
      struct st_table *   iv_index_tbl
 This is a table that holds instance variable name to index mapping. More...
 
   }   heap
 Object that use separated memory region for instance variables use this pattern. More...
 
   VALUE   ary [ROBJECT_EMBED_LEN_MAX]
 Embedded instance variables. More...
 
as
 Object's specific fields. More...
 

Detailed Description

Ruby's ordinal objects.

Unless otherwise special cased, all predefined and user-defined classes share this struct to hold their instances.

Definition at line 3676 of file rb_mjit_min_header-3.1.3.h.

Field Documentation

◆ ary

Embedded instance variables.

When an object is small enough, it uses this area to store the instance variables.

Definition at line 3684 of file rb_mjit_min_header-3.1.3.h.

◆ 

union { ... } RObject::as

Object's specific fields.

◆ basic

struct RBasic RObject::basic

Basic part, including flags and class.

Definition at line 3677 of file rb_mjit_min_header-3.1.3.h.

◆ 

struct { ... } RObject::heap

Object that use separated memory region for instance variables use this pattern.

◆ iv_index_tbl

struct st_table* RObject::iv_index_tbl

This is a table that holds instance variable name to index mapping.

Used when accessing instance variables using names.

Definition at line 3682 of file rb_mjit_min_header-3.1.3.h.

◆ ivptr

VALUE* RObject::ivptr

Pointer to a C array that holds instance variables.

Definition at line 3681 of file rb_mjit_min_header-3.1.3.h.

◆ numiv

uint32_t RObject::numiv

Number of instance variables.

This is per object; objects might differ in this field even if they have the identical classes.

Definition at line 3680 of file rb_mjit_min_header-3.1.3.h.


The documentation for this struct was generated from the following files: