summaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-21 09:15:27 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-21 09:15:27 +0000
commitb2e3d5fe537dcad97beceec41020506431f67e92 (patch)
treebe9cc8c9e0edb037a137fcd17e18c134816d74d0 /gc.c
parente675e389b8ad3c3702e430b5011344a02e354662 (diff)
merges r23693 from trunk into ruby_1_9_1.
-- * gc.c (os_obj_of): invoke garbage collection before iteration, to avoid accessing half recycled object references. [ruby-dev:38613] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@23787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index c9e9a520d..bcdc9af0b 100644
--- a/gc.c
+++ b/gc.c
@@ -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
@@ -266,7 +267,7 @@ typedef struct RVALUE {
struct RComplex complex;
} as;
#ifdef GC_DEBUG
- char *file;
+ const char *file;
int line;
#endif
} RVALUE;
@@ -2164,6 +2165,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)