diff options
| author | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-02 15:18:44 +0000 |
|---|---|---|
| committer | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-07-02 15:18:44 +0000 |
| commit | c5f26a0ad8d4cd8a6a3372aa49eb7a053b2c28ae (patch) | |
| tree | 59c385212b8ee6cc5caa5e0748be71c19e5426ca /gc.c | |
| parent | 28c420e7c2631cc3a83746ab0c8a29e2702c0f93 (diff) | |
| download | ruby-c5f26a0ad8d4cd8a6a3372aa49eb7a053b2c28ae.tar.gz ruby-c5f26a0ad8d4cd8a6a3372aa49eb7a053b2c28ae.tar.xz ruby-c5f26a0ad8d4cd8a6a3372aa49eb7a053b2c28ae.zip | |
* gc.c: add rb_during_gc(). based on a patch from arton <artonx AT
yahoo.co.jp> at [ruby-dev:35313].
* include/ruby/intern.h: ditto.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
| -rw-r--r-- | gc.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -723,6 +723,23 @@ rb_fill_value_cache(rb_thread_t *th) } #endif +int +rb_during_gc(void) +{ +#if USE_VALUE_CACHE + rb_thread_t *th = GET_THREAD(); + VALUE v = *th->value_cache_ptr; +#if defined(ENABLE_VM_OBJSPACE) && ENABLE_VM_OBJSPACE + rb_objspace_t *objspace = th->vm->objspace; +#else + rb_objspace_t *objspace = &rb_objspace; +#endif +#else + rb_objspace_t *objspace = &rb_objspace; +#endif + return during_gc; +} + VALUE rb_newobj(void) { |
