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
56 enum ruby_robject_flags {
146 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 implementation detail of RB_FL_ANY().
@ RUBY_FL_USER1
User-defined flag.
char * ptr
Pointer to the underlying memory region, of at least capa bytes.
#define inline
Old Visual Studio versions do not support the inline keyword, so we need to define it to be __inline.
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 object's base components.
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.
union RObject::@50 as
Object's specific fields.
struct RObject::@50::@51 heap
Object that use separated memory region for instance variables use this pattern.
uintptr_t VALUE
Type that represents a Ruby object.
Defines enum ruby_value_type.