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_NUMIV ROBJECT_NUMIV
48 #define ROBJECT_IVPTR ROBJECT_IVPTR
49 #define ROBJECT_IV_INDEX_TBL ROBJECT_IV_INDEX_TBL
57 enum ruby_robject_flags {
144 static inline uint32_t
153 return ROBJECT(obj)->as.heap.numiv;
170 static inline
VALUE *
181 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.
static VALUE * ROBJECT_IVPTR(VALUE obj)
Queries the instance variables.
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 uint32_t ROBJECT_NUMIV(VALUE obj)
Queries the number of instance variables.
Ruby's object's, base components.
struct st_table * iv_index_tbl
This is a table that holds instance variable name to index mapping.
struct RObject::@45::@46 heap
Object that use separated memory region for instance variables use this pattern.
union RObject::@45 as
Object's specific fields.
struct RBasic basic
Basic part, including flags and class.
VALUE * ivptr
Pointer to a C array that holds instance variables.
uint32_t numiv
Number of instance variables.
VALUE ary[ROBJECT_EMBED_LEN_MAX]
Embedded instance variables.
uintptr_t VALUE
Type that represents a Ruby object.
Defines enum ruby_value_type.