be marked by itself. Patch by Koichi Sasada.
[ruby-dev:44567] [Bug #5386]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
guard page should have PROT_NONE.
* cont.c (fiber_initialize_machine_stack_context):
th->machine_stack_maxsize shouldn't be included guard pages size.
[Bug #4983][ruby-dev:44043]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Fiber caused SEGV. I haven't follow up the issue deeply, but it
works when disabling the feature.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
On clang -O, it is needed to avoid the optimization.
With this and llvm/clang's recent fix, clang 3.0 can
build ruby-trunk with -O option.
* cont.c (cont_capture): use for-loop.
* array.c (rb_ary_each): add volatile and use it.
* vm_insnhelper.c (vm_call_cfunc): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
rb_context_t::saved_thread.machine_stack_start and
machine_stack_end should be cleared immediately after a snapshot of
current thread is stored to saved_thread.
this change aims to get rid of unnecessary GC mark at machine stack.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
in cont_mark() only RUNNING fiber's machine stack is marked.
root fiber's status should be RUNNING at the beginning regardless of
FIBER_USE_NATIVE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
you can suppress use of setcontext for Fiber with compile option
-DFIBER_USE_NATIVE=0
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
prevent mark machine stack of GC'ed Thread. root Fiber is not initialized by
fiber_init(). based on a patch by Serge Balyuk [ruby-core:35891] fixes#4612
* test/ruby/test_fiber.rb (test_gc_root_fiber): add test for it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
unnecessary fibers and retry to create. based on a patch from
masaya tarui at [ruby-dev:41230].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
on Windows because Fiber APIs are supported only such building
(and running) environments.
[ruby-dev:41192]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Fiber context switching cost using system APIs. Detail comments
are written in cont.c.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
added. Unlinked method entries are collected to
vm->unlinked_method_entry_list. On the GC timing, mark all method
entries which are on all living threads. Only non-marked method
entries are collected. This hack prevents releasing living method
entry.
[Performance Consideration] Since this Method Entry GC (MEGC)
doesn't occuer frequently, MEGC will not be a performance bottleneck.
However, to traverse living method entries, every control frame push
needs to clear cfp->me field. This will be a performance issue
(because pushing control frame is occurred frequently).
Bug #2777 [ruby-dev:40457]
* cont.c (fiber_init): init cfp->me.
* gc.c (garbage_collect): kick rb_sweep_method_entry().
* method.h (rb_method_entry_t): add a mark field.
* vm.c (invoke_block_from_c): set passed me.
* vm.c (rb_thread_mark): mark cfp->me.
* vm_core.h (rb_thread_t): add a field passed_me.
* vm_core.h (rb_vm_t): add a field unlinked_method_entry_list.
* vm_insnhelper.c (vm_push_frame): clear cfp->me at all times.
* vm_insnhelper.c (vm_call_bmethod): pass me.
* bootstraptest/test_method.rb: add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
it seems not to make sense. [ruby-dev:40121]
* vm_core.h, eval.c (rb_protect): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e