Ruby  2.1.10p492(2016-04-01revision54464)
Data Structures | Macros | Functions | Variables
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
 

Macros

#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
 

Macro Definition Documentation

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

Referenced by obj_type().

Function Documentation

static void dump_append ( struct dump_config dc,
const char *  format,
  ... 
)
static
static void dump_append_string_value ( struct dump_config dc,
VALUE  obj 
)
static

Definition at line 55 of file objspace_dump.c.

References c, dump_append(), i, RSTRING_LEN, RSTRING_PTR, and value.

Referenced by dump_object().

static void dump_object ( VALUE  obj,
struct dump_config dc 
)
static
static VALUE dump_output ( struct dump_config dc,
VALUE  opts,
VALUE  output,
const char *  filename 
)
static
static VALUE dump_result ( struct dump_config dc,
VALUE  output 
)
static

Definition at line 339 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 276 of file objspace_dump.c.

References dump_object(), RBASIC, and v.

Referenced by objspace_dump_all().

void Init_objspace_dump ( VALUE  rb_mObjSpace)
static const char* obj_type ( VALUE  obj)
inlinestatic

Definition at line 96 of file objspace_dump.c.

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

Referenced by dump_object().

static VALUE objspace_dump ( int  argc,
VALUE argv,
VALUE  os 
)
static

Definition at line 368 of file objspace_dump.c.

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

Referenced by Init_objspace_dump().

static VALUE objspace_dump_all ( int  argc,
VALUE argv,
VALUE  os 
)
static
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 287 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().