From: ts Date: 2000-10-08T20:53:05+09:00 Subject: [ruby-talk:5327] Re: Ruby 1.6.1 config+widget problems. >>>>> "s" == schneik writes: s> malloc.realloc(??, ??) at 0xd016e830 s> ruby_xrealloc(0x2ff17d90, 0x28), line 117 in "gc.c" s> unnamed block $b400, line 4623 in "parse.y" s> top_local_setup(), line 4623 in "parse.y" Try this patch. It call scope_dup (which transform a SCOPE_ALLOCA in a SCOPE_MALLOC) rather than just setting the flag SCOPE_DONT_RECYCLE pigeon% diff -u eval.c~ eval.c --- eval.c~ Wed Sep 27 05:43:12 2000 +++ eval.c Sun Oct 8 13:20:26 2000 @@ -796,10 +796,12 @@ typedef struct thread * rb_thread_t; static rb_thread_t curr_thread = 0; +static void scope_dup(struct SCOPE *); #define POP_SCOPE() \ if (ruby_scope->flag & SCOPE_DONT_RECYCLE) {\ - if (_old) _old->flag |= SCOPE_DONT_RECYCLE;\ + if (_old)\ + scope_dup(_old);\ } \ if (!(ruby_scope->flag & SCOPE_MALLOC)) {\ ruby_scope->local_vars = 0; \ @@ -1259,7 +1261,7 @@ } if (ruby_scope->flag & SCOPE_DONT_RECYCLE) - saved_scope->flag |= SCOPE_DONT_RECYCLE; + scope_dup(saved_scope); ruby_scope = saved_scope; ruby_safe_level = safe; POP_TAG(); @@ -3499,7 +3501,7 @@ ruby_block = block; ruby_frame = ruby_frame->prev; if (ruby_scope->flag & SCOPE_DONT_RECYCLE) - old_scope->flag |= SCOPE_DONT_RECYCLE; + scope_dup(old_scope); ruby_scope = old_scope; if (state) JUMP_TAG(state); return result; @@ -4650,7 +4652,7 @@ if (!NIL_P(scope)) { ruby_frame = frame.tmp; if (ruby_scope->flag & SCOPE_DONT_RECYCLE) - old_scope->flag |= SCOPE_DONT_RECYCLE; + scope_dup(old_scope); ruby_scope = old_scope; ruby_block = old_block; ruby_dyna_vars = old_d_vars; @@ -8178,7 +8180,7 @@ cont = Data_Wrap_Struct(rb_cCont, thread_mark, thread_free, th); - ruby_scope->flag |= SCOPE_DONT_RECYCLE; + scope_dup(ruby_scope); for (tag=prot_tag; tag; tag=tag->prev) { scope_dup(tag->scope); } pigeon% Guy Decoux