Ruby
2.1.10p492(2016-04-01revision54464)
|
#include <ruby/ruby.h>
#include <ruby/st.h>
#include <ruby/io.h>
#include <ruby/re.h>
#include "node.h"
#include "gc.h"
#include "internal.h"
Go to the source code of this file.
Data Structures | |
struct | total_data |
struct | rof_data |
struct | rofr_data |
Macros | |
#define | CASE_TYPE(t) case t: type = ID2SYM(rb_intern(#t)); break; |
#define | COUNT_NODE(n) case n: node = ID2SYM(rb_intern(#n)); break; |
Functions | |
static VALUE | memsize_of_m (VALUE self, VALUE obj) |
static int | total_i (void *vstart, void *vend, size_t stride, void *ptr) |
static VALUE | memsize_of_all_m (int argc, VALUE *argv, VALUE self) |
static int | set_zero_i (st_data_t key, st_data_t val, st_data_t arg) |
static int | cos_i (void *vstart, void *vend, size_t stride, void *data) |
static VALUE | type2sym (enum ruby_value_type i) |
static VALUE | count_objects_size (int argc, VALUE *argv, VALUE os) |
static int | cn_i (void *vstart, void *vend, size_t stride, void *n) |
static VALUE | count_nodes (int argc, VALUE *argv, VALUE os) |
static int | cto_i (void *vstart, void *vend, size_t stride, void *data) |
static VALUE | count_tdata_objects (int argc, VALUE *argv, VALUE self) |
static void | iow_mark (void *ptr) |
static size_t | iow_size (const void *ptr) |
static VALUE | iow_newobj (VALUE obj) |
static VALUE | iow_type (VALUE self) |
static VALUE | iow_inspect (VALUE self) |
static VALUE | iow_internal_object_id (VALUE self) |
static void | reachable_object_from_i (VALUE obj, void *data_ptr) |
static int | collect_values (st_data_t key, st_data_t value, st_data_t data) |
static VALUE | reachable_objects_from (VALUE self, VALUE obj) |
static void | reachable_object_from_root_i (const char *category, VALUE obj, void *ptr) |
static int | collect_values_of_values (VALUE category, VALUE category_objects, VALUE categories) |
static VALUE | reachable_objects_from_root (VALUE self) |
void | Init_object_tracing (VALUE rb_mObjSpace) |
void | Init_objspace_dump (VALUE rb_mObjSpace) |
void | Init_objspace (void) |
Variables | |
static const rb_data_type_t | iow_data_type |
static VALUE | rb_mInternalObjectWrapper |
Referenced by count_nodes().
|
static |
Definition at line 237 of file objspace.c.
References BUILTIN_TYPE, nd_type, RBASIC, and T_NODE.
Referenced by count_nodes().
Definition at line 581 of file objspace.c.
References rb_ary_push(), and ST_CONTINUE.
Referenced by collect_values_of_values(), and reachable_objects_from().
|
static |
Definition at line 694 of file objspace.c.
References rofr_data::categories, collect_values(), rb_ary_new(), rb_hash_aset(), rb_hash_tbl(), ST_CONTINUE, and st_foreach().
Referenced by reachable_objects_from_root().
|
static |
Definition at line 126 of file objspace.c.
References BUILTIN_TYPE, rb_obj_memsize_of(), and RBASIC.
Referenced by count_objects_size().
Definition at line 276 of file objspace.c.
References argc, argv, cn_i(), COUNT_NODE, hash(), INT2FIX, NODE_ALIAS, NODE_ALLOCA, NODE_AND, NODE_ARGS, NODE_ARGS_AUX, NODE_ARGSCAT, NODE_ARGSPUSH, NODE_ARRAY, NODE_ATTRASGN, NODE_BACK_REF, NODE_BEGIN, NODE_BLOCK, NODE_BLOCK_ARG, NODE_BLOCK_PASS, NODE_BMETHOD, NODE_BREAK, NODE_CALL, NODE_CASE, NODE_CDECL, NODE_CLASS, NODE_COLON2, NODE_COLON3, NODE_CONST, NODE_CREF, NODE_CVAR, NODE_CVASGN, NODE_CVDECL, NODE_DASGN, NODE_DASGN_CURR, NODE_DEFINED, NODE_DEFN, NODE_DEFS, NODE_DOT2, NODE_DOT3, NODE_DREGX, NODE_DREGX_ONCE, NODE_DSTR, NODE_DSYM, NODE_DVAR, NODE_DXSTR, NODE_ENSURE, NODE_ERRINFO, NODE_EVSTR, NODE_FALSE, NODE_FCALL, NODE_FLIP2, NODE_FLIP3, NODE_FOR, NODE_GASGN, NODE_GVAR, NODE_HASH, NODE_IASGN, NODE_IASGN2, NODE_IF, NODE_IFUNC, NODE_ITER, NODE_IVAR, NODE_KW_ARG, NODE_LAMBDA, NODE_LASGN, NODE_LAST, NODE_LIT, NODE_LVAR, NODE_MASGN, NODE_MATCH, NODE_MATCH2, NODE_MATCH3, NODE_MEMO, NODE_MODULE, NODE_NEXT, NODE_NIL, NODE_NTH_REF, NODE_OP_ASGN1, NODE_OP_ASGN2, NODE_OP_ASGN_AND, NODE_OP_ASGN_OR, NODE_OP_CDECL, NODE_OPT_ARG, NODE_OPT_N, NODE_OR, NODE_POSTARG, NODE_POSTEXE, NODE_PRELUDE, NODE_REDO, NODE_RESBODY, NODE_RESCUE, NODE_RETRY, NODE_RETURN, NODE_SCLASS, NODE_SCOPE, NODE_SELF, NODE_SPLAT, NODE_STR, NODE_SUPER, NODE_TO_ARY, NODE_TRUE, NODE_UNDEF, NODE_UNTIL, NODE_VALIAS, NODE_VALUES, NODE_VCALL, NODE_WHEN, NODE_WHILE, NODE_XSTR, NODE_YIELD, NODE_ZARRAY, NODE_ZSUPER, Qnil, rb_eTypeError, rb_hash_aset(), rb_hash_new(), rb_objspace_each_objects(), rb_raise(), rb_scan_args(), RB_TYPE_P, RHASH_EMPTY_P, RHASH_TBL, set_zero_i(), SIZET2NUM, st_foreach(), and T_HASH.
Referenced by Init_objspace().
Definition at line 200 of file objspace.c.
References argc, argv, cos_i(), hash(), ID2SYM, Qnil, rb_eTypeError, rb_hash_aset(), rb_hash_new(), rb_intern, rb_objspace_each_objects(), rb_raise(), rb_scan_args(), RB_TYPE_P, RHASH_EMPTY_P, RHASH_TBL, set_zero_i(), SIZET2NUM, st_foreach(), T_HASH, T_MASK, total_data::total, type, and type2sym().
Referenced by Init_objspace().
Definition at line 485 of file objspace.c.
References argc, argv, cto_i(), hash(), Qnil, rb_eTypeError, rb_hash_new(), rb_objspace_each_objects(), rb_raise(), rb_scan_args(), RB_TYPE_P, RHASH_EMPTY_P, RHASH_TBL, set_zero_i(), st_foreach(), and T_HASH.
Referenced by Init_objspace().
|
static |
Definition at line 421 of file objspace.c.
References BUILTIN_TYPE, FIX2INT, hash(), ID2SYM, INT2FIX, key, name, NIL_P, rb_hash_aref(), rb_hash_aset(), rb_intern, rb_objspace_data_type_name(), RBASIC, and T_DATA.
Referenced by count_tdata_objects().
void Init_object_tracing | ( | VALUE | rb_mObjSpace | ) |
Definition at line 472 of file object_tracing.c.
References allocation_class_path(), allocation_generation(), allocation_method_id(), allocation_sourcefile(), allocation_sourceline(), rb_define_module(), rb_define_module_function(), trace_object_allocations(), trace_object_allocations_clear(), trace_object_allocations_debug_start(), trace_object_allocations_start(), and trace_object_allocations_stop().
Referenced by Init_objspace().
void Init_objspace | ( | void | ) |
Definition at line 741 of file objspace.c.
References count_nodes(), count_objects_size(), count_tdata_objects(), Init_object_tracing(), Init_objspace_dump(), iow_inspect(), iow_internal_object_id(), iow_type(), memsize_of_all_m(), memsize_of_m(), rb_cObject, rb_const_get(), rb_define_class_under(), rb_define_method(), rb_define_module(), rb_define_module_function(), rb_intern, rb_mInternalObjectWrapper, reachable_objects_from(), and reachable_objects_from_root().
void Init_objspace_dump | ( | VALUE | rb_mObjSpace | ) |
Definition at line 421 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().
Definition at line 543 of file objspace.c.
References BUILTIN_TYPE, DATA_PTR, rb_id2name(), rb_sprintf(), SYM2ID, type, and type2sym().
Referenced by Init_objspace().
Definition at line 553 of file objspace.c.
References DATA_PTR, and rb_obj_id().
Referenced by Init_objspace().
|
static |
Definition at line 507 of file objspace.c.
References rb_gc_mark().
Definition at line 528 of file objspace.c.
References iow_data_type, rb_data_typed_object_alloc(), and rb_mInternalObjectWrapper.
Referenced by reachable_object_from_i(), and reachable_object_from_root_i().
|
static |
Definition at line 513 of file objspace.c.
References rb_obj_memsize_of().
Definition at line 535 of file objspace.c.
References BUILTIN_TYPE, DATA_PTR, and type2sym().
Referenced by Init_objspace().
Definition at line 104 of file objspace.c.
References argc, argv, total_data::klass, rb_objspace_each_objects(), rb_scan_args(), SIZET2NUM, total_data::total, and total_i().
Referenced by Init_objspace().
Definition at line 37 of file objspace.c.
References rb_obj_memsize_of(), and SIZET2NUM.
Referenced by Init_objspace().
|
static |
Definition at line 565 of file objspace.c.
References rof_data::internals, iow_newobj(), key, rb_ary_push(), rb_objspace_internal_object_p(), rb_objspace_markable_object_p(), rof_data::refs, st_insert(), and val.
Referenced by reachable_objects_from().
Definition at line 662 of file objspace.c.
References rofr_data::categories, iow_newobj(), rofr_data::last_category, rofr_data::last_category_objects, rofr_data::last_category_str, NIL_P, rb_bug(), rb_funcall(), rb_hash_aset(), rb_hash_lookup, rb_hash_new(), rb_intern, rb_objspace_internal_object_p(), rb_objspace_markable_object_p(), and rb_str_new2.
Referenced by reachable_objects_from_root().
Definition at line 631 of file objspace.c.
References collect_values(), DATA_PTR, rof_data::internals, iow_data_type, Qnil, rb_ary_new(), rb_objspace_markable_object_p(), rb_objspace_reachable_objects_from(), rb_typeddata_is_kind_of(), reachable_object_from_i(), rof_data::refs, st_data_t, st_foreach(), and st_init_numtable().
Referenced by Init_objspace().
Definition at line 709 of file objspace.c.
References rofr_data::categories, collect_values_of_values(), hash(), rofr_data::last_category, rb_funcall(), rb_hash_foreach(), rb_hash_new(), rb_intern, rb_objspace_reachable_objects_from_root(), and reachable_object_from_root_i().
Referenced by Init_objspace().
Definition at line 117 of file objspace.c.
References hash(), INT2FIX, key, rb_hash_aset(), and ST_CONTINUE.
Referenced by count_nodes(), count_objects_size(), and count_tdata_objects().
|
static |
Definition at line 48 of file objspace.c.
References BUILTIN_TYPE, FL_SINGLETON, FL_TEST, total_data::klass, rb_obj_is_kind_of(), rb_obj_memsize_of(), RBASIC, T_CLASS, T_ICLASS, T_NODE, T_NONE, T_ZOMBIE, and total_data::total.
Referenced by memsize_of_all_m().
|
static |
Definition at line 140 of file objspace.c.
References CASE_TYPE, rb_bug(), T_ARRAY, T_BIGNUM, T_CLASS, T_COMPLEX, T_DATA, T_FALSE, T_FILE, T_FIXNUM, T_FLOAT, T_HASH, T_ICLASS, T_MATCH, T_MODULE, T_NIL, T_NODE, T_NONE, T_OBJECT, T_RATIONAL, T_REGEXP, T_STRING, T_STRUCT, T_SYMBOL, T_TRUE, T_UNDEF, T_ZOMBIE, and type.
Referenced by count_objects_size(), iow_inspect(), and iow_type().
|
static |
Definition at line 519 of file objspace.c.
Referenced by iow_newobj(), and reachable_objects_from().
|
static |
Definition at line 525 of file objspace.c.
Referenced by Init_objspace(), and iow_newobj().