* 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
This commit is contained in:
parent
b1f3890b57
commit
50e7cb3b38
@ -1,3 +1,8 @@
|
|||||||
|
Mon Jun 15 17:48:42 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* gc.c (os_obj_of): invoke garbage collection before iteration, to
|
||||||
|
avoid accessing half recycled object references. [ruby-dev:38613]
|
||||||
|
|
||||||
Mon Jun 15 11:04:30 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Mon Jun 15 11:04:30 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* .gdbinit (rp, iseq): load dummy_gdb_enums on demand.
|
* .gdbinit (rp, iseq): load dummy_gdb_enums on demand.
|
||||||
|
4
gc.c
4
gc.c
@ -85,6 +85,7 @@ void *alloca ();
|
|||||||
int ruby_gc_debug_indent = 0;
|
int ruby_gc_debug_indent = 0;
|
||||||
|
|
||||||
#undef GC_DEBUG
|
#undef GC_DEBUG
|
||||||
|
#define GC_DEBUG
|
||||||
|
|
||||||
/* for GC profile */
|
/* for GC profile */
|
||||||
#define GC_PROFILE_MORE_DETAIL 0
|
#define GC_PROFILE_MORE_DETAIL 0
|
||||||
@ -272,7 +273,7 @@ typedef struct RVALUE {
|
|||||||
struct RComplex complex;
|
struct RComplex complex;
|
||||||
} as;
|
} as;
|
||||||
#ifdef GC_DEBUG
|
#ifdef GC_DEBUG
|
||||||
char *file;
|
const char *file;
|
||||||
int line;
|
int line;
|
||||||
#endif
|
#endif
|
||||||
} RVALUE;
|
} RVALUE;
|
||||||
@ -2392,6 +2393,7 @@ os_obj_of(rb_objspace_t *objspace, VALUE of)
|
|||||||
RVALUE *p, *pend;
|
RVALUE *p, *pend;
|
||||||
volatile VALUE v;
|
volatile VALUE v;
|
||||||
|
|
||||||
|
rb_garbage_collect();
|
||||||
i = 0;
|
i = 0;
|
||||||
while (i < heaps_used) {
|
while (i < heaps_used) {
|
||||||
while (0 < i && (uintptr_t)membase < (uintptr_t)heaps[i-1].membase)
|
while (0 < i && (uintptr_t)membase < (uintptr_t)heaps[i-1].membase)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user