2#define RUBY_INTERNAL_H 1
12#include "ruby/internal/config.h"
18#define LIKELY(x) RB_LIKELY(x)
19#define UNLIKELY(x) RB_UNLIKELY(x)
21#define numberof(array) ((int)(sizeof(array) / sizeof((array)[0])))
22#define roomof(x, y) (((x) + (y) - 1) / (y))
23#define type_roomof(x, y) roomof(sizeof(x), sizeof(y))
26#define ACCESS_ONCE(type,x) (*((volatile type *)&(x)))
28#define UNDEF_P RB_UNDEF_P
29#define NIL_OR_UNDEF_P RB_NIL_OR_UNDEF_P
59#define rb_ary_new_from_args(...) rb_nonexistent_symbol(__VA_ARGS__)
62#define rb_io_fptr_finalize(...) rb_nonexistent_symbol(__VA_ARGS__)
65#define rb_fstring_cstr(...) rb_nonexistent_symbol(__VA_ARGS__)
68#define rb_sym_intern_ascii_cstr(...) rb_nonexistent_symbol(__VA_ARGS__)
71#define rb_funcallv(...) rb_nonexistent_symbol(__VA_ARGS__)
72#define rb_method_basic_definition_p(...) rb_nonexistent_symbol(__VA_ARGS__)
78void rb_obj_info_dump(
VALUE obj);
79void rb_obj_info_dump_loc(
VALUE obj,
const char *file,
int line,
const char *func);
83RUBY_SYMBOL_EXPORT_BEGIN
84void ruby_debug_breakpoint(
void);
85PRINTF_ARGS(
void ruby_debug_printf(
const char*, ...), 1, 2);
89#define rp(obj) rb_obj_info_dump_loc((VALUE)(obj), __FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING)
92#define rp_m(msg, obj) do { \
93 fputs((msg), stderr); \
94 rb_obj_info_dump((VALUE)(obj)); \
99#define bp() ruby_debug_breakpoint()
101#define RBOOL(v) ((v) ? Qtrue : Qfalse)
102#define RB_BIGNUM_TYPE_P(x) RB_TYPE_P((x), T_BIGNUM)
106#define memcpy ruby_nonempty_memcpy
uintptr_t VALUE
Type that represents a Ruby object.