Ruby: RObject Struct Reference

Ruby 3.4.3p32 (2025-04-14 revision d0b7e5b6a04bde21ca483d20a1546b28b401c2d4)

Data Fields
RObject Struct Reference

Ruby's ordinal objects. More...

`#include <robject.h>`

## Data Fields
struct RBasic | basic
| Basic part, including flags and class.
union { |
struct { |
VALUE * ivptr |
| Pointer to a C array that holds instance variables. More...
struct rb_id_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 [1] |
} | as |
| Object's specific fields.

## 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 83 of file robject.h.

## Field Documentation

## ◆ ary

VALUE RObject::ary[1]

Definition at line 118 of file robject.h.

## ◆ [union]

union { ... } RObject::as

Object's specific fields.

## ◆ basic

struct RBasic RObject::basic

Basic part, including flags and class.

Definition at line 86 of file robject.h.

## ◆ [struct]

struct { ... } RObject::heap

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

## ◆ iv_index_tbl

struct rb_id_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 107 of file robject.h.

## ◆ ivptr

VALUE* RObject::ivptr

Pointer to a C array that holds instance variables.

Definition at line 97 of file robject.h.

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

- include/ruby/internal/core/robject.h