From: nobuyoshi nakada Date: 2005-10-25T14:18:00+09:00 Subject: Re: Crash in Tk demo of Ruby 1.9.0 CVS Hi, At Tue, 25 Oct 2005 13:39:36 +0900, H.Yamamoto wrote in [ruby-core:06384]: > >> This adhok patch seems to prevent this error, but I don't think this patch is good enough. > >> (I don't know GC mechanizm. Just tried and run fine.) > > > >The patch changes garbage_collect() to return now whether > >there're rooms for new objects, rather than whether GC run. > >It seems OK. > > > >And the succeeding line is not used. > > > > if (during_gc) return Qfalse; > > OK, I'll commit this. Sorry, I suspect it might have to return Qtrue also when freelist is non-null already, if the above description is correct. Index: gc.c =================================================================== RCS file: /src/ruby/gc.c,v retrieving revision 1.214 diff -u -w -b -p -r1.214 gc.c --- gc.c 18 Oct 2005 17:35:18 -0000 1.214 +++ gc.c 25 Oct 2005 04:17:13 -0000 @@ -1280,10 +1280,9 @@ garbage_collect(void) if (dont_gc || during_gc) { if (!freelist) { add_heap(); } - return Qfalse; + return Qtrue; } - if (during_gc) return Qfalse; during_gc++; init_mark_stack(); -- Nobu Nakada