diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-05-30 05:56:13 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-05-30 05:56:13 +0000 |
commit | 284565992f487937080230d3ae2b5afae4c8ac3f (patch) | |
tree | 372a124cb831288479f8807bcb53d3cfbf533b9b /vm.c | |
parent | 426fcba8916780c99c7280a8278f84d81ff3d05e (diff) | |
download | ruby-284565992f487937080230d3ae2b5afae4c8ac3f.tar.gz |
* cont.c (cont_capture): store all local variables in heap
([ruby-dev:30832]).
* vm.c (th_stack_to_heap): added.
* test/ruby/test_continuation.rb: add a test for above.
* eval_intern.h (th_get_ruby_level_cfp): fix to clean code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -400,7 +400,6 @@ th_collect_local_variables_in_heap(rb_thread_t *th, VALUE *dfp, VALUE ary) } } - VALUE th_make_env_object(rb_thread_t *th, rb_control_frame_t *cfp) { @@ -413,6 +412,16 @@ th_make_env_object(rb_thread_t *th, rb_control_frame_t *cfp) return envval; } +void +th_stack_to_heap(rb_thread_t *th) +{ + rb_control_frame_t *cfp = th->cfp; + while ((cfp = th_get_ruby_level_cfp(th, cfp)) != 0) { + th_make_env_object(th, cfp); + cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp); + } +} + static VALUE th_make_proc_from_block(rb_thread_t *th, rb_control_frame_t *cfp, rb_block_t *block) |