1#ifndef RBIMPL_ROBJECT_H
2#define RBIMPL_ROBJECT_H
23#include "ruby/internal/config.h"
32#include "ruby/internal/cast.h"
43#define ROBJECT(obj) RBIMPL_CAST((struct RObject *)(obj))
45#define ROBJECT_EMBED_LEN_MAX ROBJECT_EMBED_LEN_MAX
46#define ROBJECT_EMBED ROBJECT_EMBED
47#define ROBJECT_IV_CAPACITY ROBJECT_IV_CAPACITY
48#define ROBJECT_IVPTR ROBJECT_IVPTR
56enum ruby_robject_flags {
143static const int32_t ROBJECT_OFFSET_AS_HEAP_IVPTR = offsetof(
struct RObject, as.
heap.
ivptr);
145static const int32_t ROBJECT_OFFSET_AS_ARY = offsetof(
struct RObject, as.
ary);
172 return ptr->as.heap.ivptr;
Defines RBIMPL_ATTR_ARTIFICIAL.
#define RBIMPL_ATTR_ARTIFICIAL()
Wraps (or simulates) __attribute__((artificial))
Defines RBIMPL_ATTR_DEPRECATED.
Defines enum ruby_fl_type.
static bool RB_FL_ANY_RAW(VALUE obj, VALUE flags)
This is an implenentation detail of RB_FL_ANY().
@ RUBY_FL_USER1
User-defined flag.
Defines RBIMPL_ATTR_PURE.
#define RBIMPL_ATTR_PURE_UNLESS_DEBUG()
Enables RBIMPL_ATTR_PURE if and only if.
#define ROBJECT(obj)
Convenient casting macro.
ruby_robject_consts
This is an enum because GDB wants it (rather than a macro).
@ ROBJECT_EMBED_LEN_MAX
Max possible number of instance variables that can be embedded.
static VALUE * ROBJECT_IVPTR(VALUE obj)
Queries the instance variables.
Ruby's object's, base components.
struct RObject::@48::@49 heap
Object that use separated memory region for instance variables use this pattern.
struct RBasic basic
Basic part, including flags and class.
VALUE * ivptr
Pointer to a C array that holds instance variables.
struct rb_id_table * iv_index_tbl
This is a table that holds instance variable name to index mapping.
VALUE ary[ROBJECT_EMBED_LEN_MAX]
Embedded instance variables.
union RObject::@48 as
Object's specific fields.
uintptr_t VALUE
Type that represents a Ruby object.
Defines enum ruby_value_type.