45 vfprintf(dc->
stream, format, vl);
62 switch ((c = value[i])) {
95 static inline const char *
99 #define CASE_TYPE(type) case T_##type: return #type; break 139 dump_append(dc,
", \"references\":[\"%p\"", (
void *)ref);
239 fptr =
RFILE(obj)->fptr;
265 for (i=0; i<n; i++) {
276 heap_i(
void *vstart,
void *vend,
size_t stride,
void *data)
279 for (; v != (
VALUE)vend; v += stride) {
294 dump_append(dc,
"{\"type\":\"ROOT\", \"root\":\"%s\", \"references\":[\"%p\"", category, (
void *)obj);
370 static const char filename[] =
"rubyobj";
402 static const char filename[] =
"rubyheap";
static void root_obj_i(const char *category, VALUE obj, void *data)
#define is_broken_string(str)
static VALUE objspace_dump(int argc, VALUE *argv, VALUE os)
#define RB_OBJ_GC_FLAGS_MAX
static void dump_object(VALUE obj, struct dump_config *dc)
static void dump_append(struct dump_config *dc, const char *format,...)
#define is_ascii_string(str)
void rb_objspace_reachable_objects_from_root(void(func)(const char *category, VALUE, void *), void *passing_data)
void rb_raise(VALUE exc, const char *fmt,...)
const char * root_category
void rb_objspace_each_objects(each_obj_callback *callback, void *data)
VALUE rb_path2class(const char *)
#define GetOpenFile(obj, fp)
static unsigned char * output
size_t rb_obj_memsize_of(VALUE obj)
VALUE rb_require(const char *)
static void reachable_object_i(VALUE ref, void *data)
VALUE rb_io_get_write_io(VALUE io)
static void dump_append_string_value(struct dump_config *dc, VALUE obj)
VALUE rb_io_check_io(VALUE io)
#define HASH_PROC_DEFAULT
static VALUE dump_output(struct dump_config *dc, VALUE opts, VALUE output, const char *filename)
size_t rb_str_capacity(VALUE)
static VALUE objspace_dump_all(int argc, VALUE *argv, VALUE os)
void rb_define_module_function(VALUE module, const char *name, VALUE(*func)(ANYARGS), int argc)
Defines a module function for module.
size_t rb_obj_gc_flags(VALUE obj, ID *flags, size_t max)
VALUE rb_str_vcatf(VALUE, const char *, va_list)
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
VALUE rb_assoc_new(VALUE car, VALUE cdr)
#define STRING(string, length)
#define RARRAY_EMBED_FLAG
const char * rb_class2name(VALUE)
static int heap_i(void *vstart, void *vend, size_t stride, void *data)
void Init_objspace_dump(VALUE rb_mObjSpace)
VALUE rb_str_new_cstr(const char *)
static VALUE dump_result(struct dump_config *dc, VALUE output)
#define ENCODING_IS_ASCII8BIT(obj)
static const char * obj_type(VALUE obj)
struct allocation_info * objspace_lookup_allocation_info(VALUE obj)
#define ENCODING_GET(obj)
VALUE rb_funcallv(VALUE, ID, int, const VALUE *)
Calls a method.
void rb_objspace_reachable_objects_from(VALUE obj, void(func)(VALUE, void *), void *data)
#define RBASIC_CLASS(obj)
VALUE rb_hash_aref(VALUE hash, VALUE key)
VALUE rb_obj_frozen_p(VALUE)
const char * ruby_node_name(int node)
FILE * rb_io_stdio_file(rb_io_t *fptr)
const char * rb_id2name(ID id)
#define SPECIAL_CONST_P(x)
VALUE rb_define_module(const char *name)
size_t cur_obj_references
#define RTYPEDDATA_TYPE(v)
rb_encoding * rb_enc_from_index(int index)