ext/objspace/objspace_dump.c File Reference

#include "ruby/ruby.h"
#include "ruby/debug.h"
#include "ruby/encoding.h"
#include "ruby/io.h"
#include "gc.h"
#include "node.h"
#include "vm_core.h"
#include "objspace.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  dump_config

Defines

#define CASE_TYPE(type)   case T_##type: return #type; break

Functions

static void dump_append (struct dump_config *dc, const char *format,...)
static void dump_append_string_value (struct dump_config *dc, VALUE obj)
static const char * obj_type (VALUE obj)
static void reachable_object_i (VALUE ref, void *data)
static void dump_object (VALUE obj, struct dump_config *dc)
static int heap_i (void *vstart, void *vend, size_t stride, void *data)
static void root_obj_i (const char *category, VALUE obj, void *data)
static VALUE dump_output (struct dump_config *dc, VALUE opts, VALUE output, const char *filename)
static VALUE dump_result (struct dump_config *dc, VALUE output)
static VALUE objspace_dump (int argc, VALUE *argv, VALUE os)
static VALUE objspace_dump_all (int argc, VALUE *argv, VALUE os)
void Init_objspace_dump (VALUE rb_mObjSpace)

Variables

static VALUE sym_output
static VALUE sym_stdout
static VALUE sym_string
static VALUE sym_file


Define Documentation

#define CASE_TYPE ( type   )     case T_##type: return #type; break


Function Documentation

static void dump_append ( struct dump_config dc,
const char *  format,
  ... 
) [static]

Definition at line 39 of file objspace_dump.c.

References rb_str_vcatf(), dump_config::stream, and dump_config::string.

Referenced by dump_append_string_value(), dump_object(), objspace_dump_all(), reachable_object_i(), and root_obj_i().

static void dump_append_string_value ( struct dump_config dc,
VALUE  obj 
) [static]

Definition at line 55 of file objspace_dump.c.

References dump_append(), RSTRING_LEN, and RSTRING_PTR.

Referenced by dump_object().

static void dump_object ( VALUE  obj,
struct dump_config dc 
) [static]

Definition at line 147 of file objspace_dump.c.

References BUILTIN_TYPE, dump_config::cur_obj, dump_config::cur_obj_klass, dump_config::cur_obj_references, dump_append(), dump_append_string_value(), ELTS_SHARED, ENCODING_GET, ENCODING_IS_ASCII8BIT, rb_io_t::fd, FL_TEST, allocation_info::flags, allocation_info::generation, HASH_PROC_DEFAULT, is_ascii_string, is_broken_string, allocation_info::line, allocation_info::mid, nd_type, obj_type(), objspace_lookup_allocation_info(), allocation_info::path, PRIuSIZE, RARRAY_EMBED_FLAG, RARRAY_LEN, rb_class2name(), rb_enc_from_index(), rb_enc_name, rb_id2name(), rb_obj_frozen_p(), rb_obj_gc_flags(), RB_OBJ_GC_FLAGS_MAX, rb_obj_memsize_of(), rb_objspace_reachable_objects_from(), rb_str_capacity(), RBASIC_CLASS, reachable_object_i(), RFILE, RFLOAT_VALUE, RHASH_IFNONE, RHASH_SIZE, ROBJECT_NUMIV, RSTRING_FSTR, RSTRING_LEN, RTEST, RTYPEDDATA_P, RTYPEDDATA_TYPE, ruby_node_name(), STR_ASSOC_P, STR_EMBED_P, STR_NOCAPA_P, STR_SHARED_P, dump_config::string, SYM2ID, T_ARRAY, T_CLASS, T_DATA, T_FILE, T_FLOAT, T_HASH, T_MODULE, T_NODE, T_OBJECT, T_STRING, and T_ZOMBIE.

Referenced by heap_i(), and objspace_dump().

static VALUE dump_output ( struct dump_config dc,
VALUE  opts,
VALUE  output,
const char *  filename 
) [static]

Definition at line 298 of file objspace_dump.c.

References GetOpenFile, NIL_P, PRIsVALUE, Qnil, rb_assoc_new(), rb_eArgError, rb_funcallv(), rb_hash_aref(), rb_intern, rb_io_check_io(), rb_io_flush(), rb_io_get_write_io(), rb_io_stdio_file(), rb_path2class(), rb_raise(), rb_require(), rb_str_new_cstr(), RTEST, dump_config::stream, dump_config::string, sym_file, sym_output, sym_stdout, sym_string, and VALUE.

Referenced by objspace_dump(), and objspace_dump_all().

static VALUE dump_result ( struct dump_config dc,
VALUE  output 
) [static]

Definition at line 334 of file objspace_dump.c.

References Qnil, rb_io_flush(), dump_config::string, sym_file, and sym_string.

Referenced by objspace_dump(), and objspace_dump_all().

static int heap_i ( void *  vstart,
void *  vend,
size_t  stride,
void *  data 
) [static]

Definition at line 271 of file objspace_dump.c.

References dump_object(), allocation_info::flags, RBASIC, and VALUE.

Referenced by objspace_dump_all().

void Init_objspace_dump ( VALUE  rb_mObjSpace  ) 

Definition at line 416 of file objspace_dump.c.

References ID2SYM, objspace_dump(), objspace_dump_all(), rb_define_module(), rb_define_module_function(), rb_intern, rb_obj_gc_flags(), sym_file, sym_output, sym_stdout, and sym_string.

Referenced by Init_objspace().

static const char* obj_type ( VALUE  obj  )  [inline, static]

Definition at line 96 of file objspace_dump.c.

References BUILTIN_TYPE, CASE_TYPE, CLASS, FALSE, MATCH, STRING, TRUE, and UNDEF.

Referenced by dump_object().

static VALUE objspace_dump ( int  argc,
VALUE *  argv,
VALUE  os 
) [static]

Definition at line 363 of file objspace_dump.c.

References dump_object(), dump_output(), dump_result(), output, Qnil, rb_scan_args(), sym_string, and VALUE.

Referenced by Init_objspace_dump().

static VALUE objspace_dump_all ( int  argc,
VALUE *  argv,
VALUE  os 
) [static]

Definition at line 395 of file objspace_dump.c.

References dump_append(), dump_output(), dump_result(), heap_i(), output, Qnil, rb_objspace_each_objects(), rb_objspace_reachable_objects_from_root(), rb_scan_args(), root_obj_i(), dump_config::roots, sym_file, and VALUE.

Referenced by Init_objspace_dump().

static void reachable_object_i ( VALUE  ref,
void *  data 
) [static]

Definition at line 131 of file objspace_dump.c.

References dump_config::cur_obj_klass, dump_config::cur_obj_references, and dump_append().

Referenced by dump_object().

static void root_obj_i ( const char *  category,
VALUE  obj,
void *  data 
) [static]

Definition at line 282 of file objspace_dump.c.

References dump_append(), NULL, dump_config::root_category, and dump_config::roots.

Referenced by objspace_dump_all().


Variable Documentation

VALUE sym_file [static]

Definition at line 25 of file objspace_dump.c.

Referenced by dump_output(), dump_result(), Init_objspace_dump(), and objspace_dump_all().

VALUE sym_output [static]

Definition at line 25 of file objspace_dump.c.

Referenced by dump_output(), and Init_objspace_dump().

VALUE sym_stdout [static]

Definition at line 25 of file objspace_dump.c.

Referenced by dump_output(), and Init_objspace_dump().

VALUE sym_string [static]

Definition at line 25 of file objspace_dump.c.

Referenced by dump_output(), dump_result(), Init_objspace_dump(), and objspace_dump().


Generated on 19 Jul 2016 for Ruby by  doxygen 1.4.7