mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (POP_BLOCK_TAG): call rb_gc_force_recycle() if block has
not been objectified. * eval.c (rb_callcc): should nail down block->tag history to avoid rb_gc_force_recycle(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0dc1a293fd
commit
74273daffb
2 changed files with 29 additions and 11 deletions
|
@ -3,6 +3,14 @@ Wed Jan 24 14:58:08 2001 Akinori MUSHA <knu@ruby-lang.org>
|
|||
* lib/cgi.rb: fix the problem that when running under mod_ruby
|
||||
header() outputs only one Set-Cookie line.
|
||||
|
||||
Wed Jan 24 01:45:49 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (POP_BLOCK_TAG): call rb_gc_force_recycle() if block has
|
||||
not been objectified.
|
||||
|
||||
* eval.c (rb_callcc): should nail down block->tag history to avoid
|
||||
rb_gc_force_recycle().
|
||||
|
||||
Tue Jan 23 18:51:57 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* gc.c (rb_gc_call_finalizer_at_exit): should finalize objects in
|
||||
|
|
32
eval.c
32
eval.c
|
@ -583,21 +583,18 @@ new_blktag()
|
|||
_block.dyna_vars = ruby_dyna_vars; \
|
||||
ruby_block = &_block;
|
||||
|
||||
#define POP_BLOCK_TAG(tag) do { \
|
||||
if ((tag)->flags & BLOCK_DYNAMIC) \
|
||||
(tag)->flags |= BLOCK_ORPHAN; \
|
||||
else \
|
||||
rb_gc_force_recycle((VALUE)tag); \
|
||||
} while (0)
|
||||
|
||||
#define POP_BLOCK() \
|
||||
_block.tag->flags |= BLOCK_ORPHAN; \
|
||||
POP_BLOCK_TAG(_block.tag); \
|
||||
ruby_block = _block.prev; \
|
||||
}
|
||||
|
||||
#define PUSH_BLOCK2(b) { \
|
||||
struct BLOCK * volatile _old; \
|
||||
_old = ruby_block; \
|
||||
ruby_block = b;
|
||||
|
||||
#define POP_BLOCK2() \
|
||||
_block.tag->flags |= BLOCK_ORPHAN; \
|
||||
ruby_block = _old; \
|
||||
}
|
||||
|
||||
struct RVarmap *ruby_dyna_vars;
|
||||
#define PUSH_VARS() { \
|
||||
struct RVarmap * volatile _old; \
|
||||
|
@ -5924,6 +5921,7 @@ blk_mark(data)
|
|||
rb_gc_mark(data->self);
|
||||
rb_gc_mark(data->dyna_vars);
|
||||
rb_gc_mark(data->klass);
|
||||
rb_gc_mark(data->tag);
|
||||
data = data->prev;
|
||||
}
|
||||
}
|
||||
|
@ -5966,6 +5964,7 @@ blk_copy_prev(block)
|
|||
MEMCPY(tmp->frame.argv, block->prev->frame.argv, VALUE, tmp->frame.argc);
|
||||
}
|
||||
scope_dup(tmp->scope);
|
||||
tmp->tag->flags |= BLOCK_DYNAMIC;
|
||||
block->prev = tmp;
|
||||
block = tmp;
|
||||
}
|
||||
|
@ -6043,6 +6042,8 @@ rb_f_binding(self)
|
|||
else {
|
||||
data->prev = 0;
|
||||
}
|
||||
data->flags |= BLOCK_DYNAMIC;
|
||||
data->tag->flags |= BLOCK_DYNAMIC;
|
||||
|
||||
for (p = data; p; p = p->prev) {
|
||||
for (vars = p->dyna_vars; vars; vars = vars->next) {
|
||||
|
@ -6126,6 +6127,7 @@ proc_new(klass)
|
|||
data->prev = 0;
|
||||
}
|
||||
data->flags |= BLOCK_DYNAMIC;
|
||||
data->tag->flags |= BLOCK_DYNAMIC;
|
||||
|
||||
for (p = data; p; p = p->prev) {
|
||||
for (vars = p->dyna_vars; vars; vars = vars->next) {
|
||||
|
@ -8405,6 +8407,14 @@ rb_callcc(self)
|
|||
for (tag=prot_tag; tag; tag=tag->prev) {
|
||||
scope_dup(tag->scope);
|
||||
}
|
||||
if (ruby_block) {
|
||||
struct BLOCK *block = ruby_block;
|
||||
|
||||
while (block) {
|
||||
block->tag->flags |= BLOCK_DYNAMIC;
|
||||
block = block->prev;
|
||||
}
|
||||
}
|
||||
th->thread = curr_thread->thread;
|
||||
|
||||
for (vars = th->dyna_vars; vars; vars = vars->next) {
|
||||
|
|
Loading…
Reference in a new issue