Ruby
2.4.2p198(2017-09-14revision59899)
|
#include "internal.h"
#include <ruby/st.h>
#include <ruby/io.h>
#include <ruby/re.h>
#include "node.h"
#include "gc.h"
#include "symbol.h"
Go to the source code of this file.
Data Structures | |
struct | total_data |
struct | dynamic_symbol_counts |
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 VALUE | setup_hash (int argc, VALUE *argv) |
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 | cs_i (void *vstart, void *vend, size_t stride, void *n) |
size_t | rb_sym_immortal_count (void) |
static VALUE | count_symbols (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 int | count_imemo_objects_i (void *vstart, void *vend, size_t stride, void *data) |
static VALUE | count_imemo_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) |
static VALUE | wrap_klass_iow (VALUE klass) |
static VALUE | objspace_internal_class_of (VALUE self, VALUE obj) |
static VALUE | objspace_internal_super_of (VALUE self, VALUE obj) |
void | Init_object_tracing (VALUE rb_mObjSpace) |
void | Init_objspace_dump (VALUE rb_mObjSpace) |
void | Init_objspace (void) |
Variables | |
static ID | imemo_type_ids [imemo_mask+1] |
static const rb_data_type_t | iow_data_type |
static VALUE | rb_mInternalObjectWrapper |
Referenced by type2sym().
Referenced by count_nodes().
|
static |
Definition at line 332 of file objspace.c.
References BUILTIN_TYPE, nd_type, RBASIC, and T_NODE.
Referenced by count_nodes().
Definition at line 732 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 844 of file objspace.c.
References 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 147 of file objspace.c.
References BUILTIN_TYPE, rb_obj_memsize_of(), and RBASIC.
Referenced by count_objects_size().
Definition at line 637 of file objspace.c.
References count_imemo_objects_i(), hash(), imemo_type_ids, rb_intern, rb_objspace_each_objects(), and setup_hash().
Referenced by Init_objspace().
|
static |
Definition at line 582 of file objspace.c.
References BUILTIN_TYPE, FIX2INT, hash(), ID2SYM, imemo_type_ids, INT2FIX, key, NIL_P, rb_hash_aref(), rb_hash_aset(), RBASIC, and T_IMEMO.
Referenced by count_imemo_objects().
Definition at line 371 of file objspace.c.
References 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_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_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_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_hash_aset(), rb_hash_new(), rb_objspace_each_objects(), RHASH_EMPTY_P, RHASH_TBL, set_zero_i(), setup_hash(), SIZET2NUM, and st_foreach.
Referenced by Init_objspace().
Definition at line 222 of file objspace.c.
References cos_i(), hash(), ID2SYM, Qnil, rb_hash_aset(), rb_hash_new(), rb_intern, rb_objspace_each_objects(), RHASH_EMPTY_P, RHASH_TBL, set_zero_i(), setup_hash(), SIZET2NUM, st_foreach, T_MASK, total_data::total, and type2sym().
Referenced by Init_objspace().
Definition at line 308 of file objspace.c.
References cs_i(), hash(), ID2SYM, dynamic_symbol_counts::immortal, dynamic_symbol_counts::mortal, Qnil, rb_hash_aset(), rb_hash_new(), rb_intern, rb_objspace_each_objects(), rb_sym_immortal_count(), RHASH_EMPTY_P, RHASH_TBL, set_zero_i(), setup_hash(), SIZET2NUM, and st_foreach.
Referenced by Init_objspace().
Definition at line 572 of file objspace.c.
References cto_i(), hash(), rb_objspace_each_objects(), and setup_hash().
Referenced by Init_objspace().
|
static |
Definition at line 259 of file objspace.c.
References BUILTIN_TYPE, ID_SCOPE_MASK, dynamic_symbol_counts::immortal, dynamic_symbol_counts::mortal, rb_sym_immortal_count(), RBASIC, RSYMBOL, and T_SYMBOL.
Referenced by count_symbols().
|
static |
Definition at line 508 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 474 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(), and objspace_internal_super_of().
void Init_objspace | ( | void | ) |
Definition at line 957 of file objspace.c.
References count_imemo_objects(), count_nodes(), count_objects_size(), count_symbols(), count_tdata_objects(), Init_object_tracing(), Init_objspace_dump(), iow_inspect(), iow_internal_object_id(), iow_type(), memsize_of_all_m(), memsize_of_m(), objspace_internal_class_of(), objspace_internal_super_of(), 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 464 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(), and objspace_internal_super_of().
Definition at line 694 of file objspace.c.
References BUILTIN_TYPE, DATA_PTR, PRIsVALUE, rb_sprintf(), rb_sym2str, and type2sym().
Referenced by Init_objspace().
Definition at line 704 of file objspace.c.
References DATA_PTR, and rb_obj_id().
Referenced by Init_objspace().
|
static |
Definition at line 658 of file objspace.c.
References rb_gc_mark().
Definition at line 679 of file objspace.c.
References rb_mInternalObjectWrapper, and TypedData_Wrap_Struct.
Referenced by reachable_object_from_i(), reachable_object_from_root_i(), and wrap_klass_iow().
|
static |
Definition at line 664 of file objspace.c.
References rb_obj_memsize_of().
Definition at line 686 of file objspace.c.
References BUILTIN_TYPE, DATA_PTR, and type2sym().
Referenced by Init_objspace().
Definition at line 105 of file objspace.c.
References total_data::klass, rb_objspace_each_objects(), rb_scan_args(), SIZET2NUM, total_data::total, and total_i().
Referenced by Init_objspace().
Definition at line 40 of file objspace.c.
References rb_obj_memsize_of(), and SIZET2NUM.
Referenced by Init_objspace().
Definition at line 895 of file objspace.c.
References CLASS_OF, DATA_PTR, total_data::klass, rb_typeddata_is_kind_of(), and wrap_klass_iow().
Referenced by Init_objspace().
Definition at line 917 of file objspace.c.
References DATA_PTR, Init_object_tracing(), Init_objspace_dump(), OBJ_BUILTIN_TYPE, rb_eArgError, rb_raise(), rb_typeddata_is_kind_of(), RCLASS_SUPER, T_CLASS, T_ICLASS, T_MODULE, and wrap_klass_iow().
Referenced by Init_objspace().
size_t rb_sym_immortal_count | ( | void | ) |
Definition at line 822 of file symbol.c.
Referenced by count_symbols(), and cs_i().
|
static |
Definition at line 716 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 813 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_hash_aset(), rb_hash_lookup(), rb_ident_hash_new(), rb_objspace_internal_object_p(), rb_objspace_markable_object_p(), and rb_str_new2.
Referenced by reachable_objects_from_root().
Definition at line 782 of file objspace.c.
References collect_values(), DATA_PTR, rof_data::internals, 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 859 of file objspace.c.
References rofr_data::categories, collect_values_of_values(), hash(), rofr_data::last_category, rb_hash_foreach(), rb_ident_hash_new(), rb_objspace_reachable_objects_from_root(), and reachable_object_from_root_i().
Referenced by Init_objspace().
Definition at line 118 of file objspace.c.
References hash(), INT2FIX, rb_hash_aset(), and ST_CONTINUE.
Referenced by count_nodes(), count_objects_size(), count_symbols(), and setup_hash().
Definition at line 127 of file objspace.c.
References hash(), Qnil, rb_eTypeError, rb_hash_new(), rb_raise(), rb_scan_args(), RB_TYPE_P, RHASH_EMPTY_P, RHASH_TBL, set_zero_i(), st_foreach, and T_HASH.
Referenced by count_imemo_objects(), count_nodes(), count_objects_size(), count_symbols(), and count_tdata_objects().
|
static |
Definition at line 51 of file objspace.c.
References BUILTIN_TYPE, total_data::klass, rb_obj_is_kind_of(), rb_obj_memsize_of(), RBASIC, T_ICLASS, T_IMEMO, T_NODE, T_NONE, T_ZOMBIE, and total_data::total.
Referenced by memsize_of_all_m().
|
static |
Definition at line 161 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_IMEMO, 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, and T_ZOMBIE.
Referenced by count_objects_size(), iow_inspect(), and iow_type().
Definition at line 872 of file objspace.c.
References iow_newobj(), total_data::klass, Qnil, RB_TYPE_P, RTEST, and T_ICLASS.
Referenced by objspace_internal_class_of(), and objspace_internal_super_of().
|
static |
Definition at line 579 of file objspace.c.
Referenced by count_imemo_objects(), and count_imemo_objects_i().
|
static |
Definition at line 670 of file objspace.c.
|
static |
Definition at line 676 of file objspace.c.
Referenced by Init_objspace(), and iow_newobj().