1 #ifndef RBIMPL_RBASIC_H
2 #define RBIMPL_RBASIC_H
28 #include "ruby/internal/cast.h"
40 #define RBASIC(obj) RBIMPL_CAST((struct RBasic *)(obj))
42 #define RBASIC_CLASS RBASIC_CLASS
43 #define RBIMPL_RVALUE_EMBED_LEN_MAX 3
44 #define RVALUE_EMBED_LEN_MAX RVALUE_EMBED_LEN_MAX
45 #define RBIMPL_EMBED_LEN_MAX_OF(T) \
46 RBIMPL_CAST((int)(sizeof(VALUE[RBIMPL_RVALUE_EMBED_LEN_MAX]) / (sizeof(T))))
153 return RBASIC(obj)->klass;
Defines RBIMPL_ATTR_ARTIFICIAL.
#define RBIMPL_ATTR_ARTIFICIAL()
Wraps (or simulates) __attribute__((artificial))
#define RBIMPL_ASSERT_OR_ASSUME(...)
This is either RUBY_ASSERT or RBIMPL_ASSUME, depending on RUBY_DEBUG.
#define RUBY_ALIGNAS
Wraps (or simulates) alignas.
#define RBIMPL_ATTR_CONSTEXPR(_)
Wraps (or simulates) C++11 constexpr.
Tweaking visibility of C variables/functions.
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Defines RBIMPL_ATTR_FORCEINLINE.
#define RBIMPL_ATTR_FORCEINLINE()
Wraps (or simulates) __forceinline.
VALUE rb_obj_reveal(VALUE obj, VALUE klass)
Make a hidden object visible again.
VALUE rb_obj_hide(VALUE obj)
Make the object invisible from Ruby code.
Defines RBIMPL_ATTR_NOALIAS.
#define RBIMPL_ATTR_NOALIAS()
Wraps (or simulates) __declspec((noalias))
#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.
static VALUE RBASIC_CLASS(VALUE obj)
Queries the class of an object.
#define RBASIC(obj)
Convenient casting macro.
ruby_rvalue_flags
This is an enum because GDB wants it (rather than a macro).
@ RVALUE_EMBED_LEN_MAX
Max possible number of objects that can be embedded.
Defines enum ruby_special_consts.
static bool RB_SPECIAL_CONST_P(VALUE obj)
Checks if the given object is of enum ruby_special_consts.
Ruby object's base components.
const VALUE klass
Class of an object.
VALUE flags
Per-object flags.
#define RBIMPL_VALUE_NULL
A compile-time constant of type VALUE whose value is 0.
#define SIZEOF_VALUE
Identical to sizeof(VALUE), except it is a macro that can also be used inside of preprocessor directi...
uintptr_t VALUE
Type that represents a Ruby object.