aboutsummaryrefslogtreecommitdiffstats
path: root/ext/objspace/objspace.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-27 10:01:45 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-27 10:01:45 +0000
commit050dd10d6f8933268ed0fd211eb5bcc8ad49f678 (patch)
tree12191d6df36efdbf607ac146a674963d8f17d6cc /ext/objspace/objspace.c
parent14f6c8ca8ae785b14718cac1ad8891ca20e604e1 (diff)
downloadruby-050dd10d6f8933268ed0fd211eb5bcc8ad49f678.tar.gz
* ext/objspace/objspace.c: support ObjectSpace.trace_object_allocations.
Read the following test to know HOWTO. This feature is a sample of RUBY_INTERNAL_EVENT. * test/objspace/test_objspace.rb: add a test. * ext/objspace/object_tracing.c: ditto. * gc.c (rb_gc_count): add. THis function returns GC count. * internal.h: add decl. of rb_gc_count(). Same as `GC.count'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/objspace/objspace.c')
-rw-r--r--ext/objspace/objspace.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/objspace/objspace.c b/ext/objspace/objspace.c
index 720c918555..a077a1e4e0 100644
--- a/ext/objspace/objspace.c
+++ b/ext/objspace/objspace.c
@@ -779,6 +779,8 @@ reachable_objects_from(VALUE self, VALUE obj)
}
}
+void Init_object_tracing(VALUE rb_mObjSpace);
+
/* objspace library extends ObjectSpace module and add several
* methods to get internal statistic information about
* object/memory management.
@@ -807,4 +809,6 @@ Init_objspace(void)
rb_define_method(rb_mInternalObjectWrapper, "type", iow_type, 0);
rb_define_method(rb_mInternalObjectWrapper, "inspect", iow_inspect, 0);
rb_define_method(rb_mInternalObjectWrapper, "internal_object_id", iow_internal_object_id, 0);
+
+ Init_object_tracing(rb_mObjSpace);
}