24#define mrb_class_ptr(v) ((struct RClass*)(mrb_ptr(v)))
29 if (!mrb_immediate_p(v)) {
30 return mrb_obj_ptr(v)->c;
33 switch (mrb_type(v)) {
36 return mrb->false_class;
37 return mrb->nil_class;
39 return mrb->true_class;
41 return mrb->symbol_class;
43 return mrb->integer_class;
46 return mrb->float_class;
49 return mrb->object_class;
64#define MRB_FL_CLASS_IS_PREPENDED (1 << 19)
65#define MRB_FL_CLASS_IS_ORIGIN (1 << 18)
66#define MRB_CLASS_ORIGIN(c) do {\
67 if ((c)->flags & MRB_FL_CLASS_IS_PREPENDED) {\
69 while (!((c)->flags & MRB_FL_CLASS_IS_ORIGIN)) {\
74#define MRB_FL_CLASS_IS_INHERITED (1 << 17)
75#define MRB_INSTANCE_TT_MASK (0x1F)
76#define MRB_SET_INSTANCE_TT(c, tt) ((c)->flags = (((c)->flags & ~MRB_INSTANCE_TT_MASK) | (char)(tt)))
77#define MRB_INSTANCE_TT(c) (enum mrb_vtype)((c)->flags & MRB_INSTANCE_TT_MASK)
78#define MRB_FL_UNDEF_ALLOCATE (1 << 6)
79#define MRB_UNDEF_ALLOCATOR(c) (mrb_assert((c)->tt == MRB_TT_CLASS), (c)->flags |= MRB_FL_UNDEF_ALLOCATE)
80#define MRB_UNDEF_ALLOCATOR_P(c) ((c)->flags & MRB_FL_UNDEF_ALLOCATE)
81#define MRB_DEFINE_ALLOCATOR(c) ((c)->flags &= ~MRB_FL_UNDEF_ALLOCATE)
92#ifndef MRB_NO_METHOD_CACHE
95#define mrb_mc_clear_by_class(mrb,c)
mruby common platform definition"
#define MRB_INLINE
Declare a function as always inlined.
Definition common.h:68
#define MRB_END_DECL
End declarations in C mode.
Definition common.h:28
#define MRB_BEGIN_DECL
Start declarations in C mode.
Definition common.h:26
#define MRB_API
Declare a public mruby API function.
Definition common.h:79
Class class.
Definition class.h:17
Definition boxing_nan.h:40