From 6c6dece7f192664986c3973ed15c994cc6af1696 Mon Sep 17 00:00:00 2001 From: ko1 Date: Wed, 24 Oct 2012 00:04:56 +0000 Subject: * ext/objspace/objspace.c (ObjectSpace.reachable_objects_from): internal object support. If given object `obj' has references to internal objects (such as T_NODE objects), then this method returns instances of `ObjectSpace::InternalObjectWrapper' instead of that internal objects. This instance contains a refereance to an internal object and you can check the type of internal object using `ObjectSpace::InternalObjectWrapper#type' method. Rdoc of `InternalObjectWrapper' is not prepared yet. * gc.c (rb_objspace_reachable_objects_from), gc.h: change an interface of 'rb_objspace_reachable_objects_from()' * gc.c, gc.h: add two APIs - rb_objspace_markable_object_p(obj): check markable or not. - rb_objspace_internal_object_p(obj): check internal or not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- gc.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gc.h') diff --git a/gc.h b/gc.h index 741945349d..2a3dd92c01 100644 --- a/gc.h +++ b/gc.h @@ -89,7 +89,9 @@ int ruby_get_stack_grow_direction(volatile VALUE *addr); /* exports for objspace module */ size_t rb_objspace_data_type_memsize(VALUE obj); -VALUE rb_objspace_reachable_objects_from(VALUE obj); +void rb_objspace_reachable_objects_from(VALUE obj, void (func)(VALUE, void *), void *data); +int rb_objspace_markable_object_p(VALUE obj); +int rb_objspace_internal_object_p(VALUE obj); void rb_objspace_each_objects( int (*callback)(void *start, void *end, size_t stride, void *data), -- cgit v1.2.3