86heap_iter(
void *vstart,
void *vend,
size_t stride,
void *
ptr)
91 for (v = (
VALUE)vstart; v != (
VALUE)vend; v += stride) {
92 void *poisoned = asan_poisoned_object_p(v);
93 asan_unpoison_object(v,
false);
100 asan_poison_object(v);
153 each_object_with_flags(total_i, &data);
172 if (!RB_TYPE_P(hash,
T_HASH))
188cos_i(
VALUE v,
void *data)
190 size_t *counts = (
size_t *)data;
199#define CASE_TYPE(t) case t: type = ID2SYM(rb_intern(#t)); break;
228 default:
rb_bug(
"type2sym: unknown type (%d)", i);
264 for (i = 0; i <=
T_MASK; i++) {
268 each_object_with_flags(cos_i, &counts[0]);
270 for (i = 0; i <=
T_MASK; i++) {
287cs_i(
VALUE v,
void *n)
337 each_object_with_flags(cs_i, &dynamic_counts);
348cn_i(
VALUE v,
void *n)
350 size_t *nodes = (
size_t *)n;
392 each_object_with_flags(cn_i, &nodes[0]);
398#define COUNT_NODE(n) case n: node = ID2SYM(rb_intern(#n)); goto set
516cto_i(
VALUE v,
void *data)
531 if (
NIL_P(counter)) {
578 each_object_with_flags(cto_i, (
void *)hash);
585count_imemo_objects_i(
VALUE v,
void *data)
595 if (
NIL_P(counter)) {
639 if (imemo_type_ids[0] == 0) {
640 imemo_type_ids[0] =
rb_intern(
"imemo_env");
641 imemo_type_ids[1] =
rb_intern(
"imemo_cref");
642 imemo_type_ids[2] =
rb_intern(
"imemo_svar");
643 imemo_type_ids[3] =
rb_intern(
"imemo_throw_data");
644 imemo_type_ids[4] =
rb_intern(
"imemo_ifunc");
645 imemo_type_ids[5] =
rb_intern(
"imemo_memo");
646 imemo_type_ids[6] =
rb_intern(
"imemo_ment");
647 imemo_type_ids[7] =
rb_intern(
"imemo_iseq");
648 imemo_type_ids[8] =
rb_intern(
"imemo_tmpbuf");
649 imemo_type_ids[9] =
rb_intern(
"imemo_ast");
650 imemo_type_ids[10] =
rb_intern(
"imemo_parser_strterm");
651 imemo_type_ids[11] =
rb_intern(
"imemo_callinfo");
652 imemo_type_ids[12] =
rb_intern(
"imemo_callcache");
653 imemo_type_ids[13] =
rb_intern(
"imemo_constcache");
656 each_object_with_flags(count_imemo_objects_i, (
void *)hash);
668iow_size(
const void *
ptr)
675 "ObjectSpace::InternalObjectWrapper",
676 {iow_mark, 0, iow_size,},
680static VALUE rb_cInternalObjectWrapper;
698iow_inspect(
VALUE self)
708iow_internal_object_id(
VALUE self)
720reachable_object_from_i(
VALUE obj,
void *data_ptr)
728 val = iow_newobj(obj);
815reachable_object_from_root_i(
const char *category,
VALUE obj,
void *
ptr)
819 VALUE category_objects;
830 rb_bug(
"reachable_object_from_root_i: category should insert at once");
839 obj = iow_newobj(obj);
861reachable_objects_from_root(
VALUE self)
874wrap_klass_iow(
VALUE klass)
879 else if (RB_TYPE_P(klass,
T_ICLASS) ||
881 return iow_newobj(klass);
898objspace_internal_class_of(
VALUE self,
VALUE obj)
911 return wrap_klass_iow(klass);
925objspace_internal_super_of(
VALUE self,
VALUE obj)
943 return wrap_klass_iow(super);
1002 rb_define_method(rb_cInternalObjectWrapper,
"internal_object_id", iow_internal_object_id, 0);
VALUE rb_ary_push(VALUE ary, VALUE item)
Internal header absorbing C compipler differences.
#define OBJ_BUILTIN_TYPE(obj)
#define rb_define_method(klass, mid, func, arity)
Defines klass#mid.
#define rb_define_module_function(klass, mid, func, arity)
Defines klass#mid and makes it a module function.
int rb_objspace_internal_object_p(VALUE obj)
VALUE rb_obj_id(VALUE obj)
size_t rb_obj_memsize_of(VALUE obj)
void rb_objspace_reachable_objects_from(VALUE obj, void(func)(VALUE, void *), void *data)
const char * rb_objspace_data_type_name(VALUE obj)
int rb_objspace_markable_object_p(VALUE obj)
void rb_gc_mark(VALUE ptr)
void rb_objspace_each_objects(each_obj_callback *callback, void *data)
void rb_objspace_reachable_objects_from_root(void(func)(const char *category, VALUE, void *), void *passing_data)
VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
Defines a class under the namespace of outer.
VALUE rb_define_module(const char *name)
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
void rb_raise(VALUE exc, const char *fmt,...)
int rb_typeddata_is_kind_of(VALUE obj, const rb_data_type_t *data_type)
void rb_bug(const char *fmt,...)
VALUE rb_ident_hash_new(void)
VALUE rb_cObject
Object class.
VALUE rb_obj_is_kind_of(VALUE, VALUE)
Determines if obj is a kind of c.
void rb_hash_foreach(VALUE hash, rb_foreach_func *func, VALUE farg)
VALUE rb_hash_aref(VALUE hash, VALUE key)
VALUE rb_hash_aset(VALUE hash, VALUE key, VALUE val)
VALUE rb_hash_lookup(VALUE hash, VALUE key)
IMEMO: Internal memo object.
VALUE rb_funcall(VALUE, ID, int,...)
Calls a method.
VALUE rb_const_get(VALUE, ID)
void rb_undef_alloc_func(VALUE)
ID rb_intern(const char *)
Internal header for Class.
Internal header for Hash.
VALUE type(ANYARGS)
ANYARGS-ed function type.
void(* each_obj_with_flags)(VALUE, void *)
void Init_object_tracing(VALUE rb_mObjSpace)
void Init_objspace_dump(VALUE rb_mObjSpace)
size_t rb_sym_immortal_count(void)
#define TypedData_Wrap_Struct(klass, data_type, sval)
@ RUBY_TYPED_FREE_IMMEDIATELY
Internal header for ASAN / MSAN / etc.
VALUE rb_sprintf(const char *,...)
const char * last_category
VALUE last_category_objects
ruby_value_type
C-level type of an object.