diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-02 11:59:50 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-04-02 11:59:50 +0000 |
commit | 37067ed905954940bafb3b2cc4e1d67c374d31f9 (patch) | |
tree | c57d1ef0dc0168291159b5b53f90623b580df33d | |
parent | b230d20ec4d4b34dbbdfe5830fee8095d41af044 (diff) |
* gc.c, gc.h (rb_objspace_each_objects_without_setup):
Add a new (hidden) C-API to iterate objspace snapshot.
This API is not safe to call any C-APIs in a given callback
function. Be careful to use this C-API.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | gc.c | 10 | ||||
-rw-r--r-- | gc.h | 4 |
3 files changed, 22 insertions, 0 deletions
@@ -1,3 +1,11 @@ +Wed Apr 2 20:57:15 2014 Koichi Sasada <[email protected]> + + * gc.c, gc.h (rb_objspace_each_objects_without_setup): + Add a new (hidden) C-API to iterate objspace snapshot. + + This API is not safe to call any C-APIs in a given callback + function. Be careful to use this C-API. + Wed Apr 2 17:43:17 2014 Nobuyoshi Nakada <[email protected]> * configure.in (ac_cv_func___builtin_setjmp): gcc 4.9 disallows a @@ -1788,6 +1788,16 @@ rb_objspace_each_objects(each_obj_callback *callback, void *data) } } +void +rb_objspace_each_objects_without_setup(each_obj_callback *callback, void *data) +{ + struct each_obj_args args; + args.callback = callback; + args.data = data; + + objspace_each_objects((VALUE)&args); +} + struct os_each_struct { size_t num; VALUE of; @@ -97,6 +97,10 @@ void rb_objspace_each_objects( int (*callback)(void *start, void *end, size_t stride, void *data), void *data); +void rb_objspace_each_objects_without_setup( + int (*callback)(void *, void *, size_t, void *), + void *data); + RUBY_SYMBOL_EXPORT_END #endif /* RUBY_GC_H */ |