diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-15 09:06:16 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-15 09:06:16 +0000 |
commit | 50e7cb3b38bb703c1b6abf00c38dddeeac4e21da (patch) | |
tree | 18b62091ac44fa262df81bb37ea62e393c27a56d /gc.c | |
parent | b1f3890b57a4a72a9f2b7b5eef445a45791a8ec5 (diff) |
* gc.c (os_obj_of): invoke garbage collection before iteration, to
avoid accessing half recycled object references. [ruby-dev:38613]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23693 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -85,6 +85,7 @@ void *alloca (); int ruby_gc_debug_indent = 0; #undef GC_DEBUG +#define GC_DEBUG /* for GC profile */ #define GC_PROFILE_MORE_DETAIL 0 @@ -272,7 +273,7 @@ typedef struct RVALUE { struct RComplex complex; } as; #ifdef GC_DEBUG - char *file; + const char *file; int line; #endif } RVALUE; @@ -2392,6 +2393,7 @@ os_obj_of(rb_objspace_t *objspace, VALUE of) RVALUE *p, *pend; volatile VALUE v; + rb_garbage_collect(); i = 0; while (i < heaps_used) { while (0 < i && (uintptr_t)membase < (uintptr_t)heaps[i-1].membase) |