aboutsummaryrefslogtreecommitdiffstats
path: root/cont.c
Commit message (Collapse)AuthorAgeFilesLines
* YJIT: Cancel on-stack jit_return on invalidation (#9086)Takashi Kokubun2023-11-301-7/+26
| | | | | | | | | | | * YJIT: Cancel on-stack jit_return on invalidation Co-authored-by: Alan Wu <alansi.xingwu@shopify.com> * Use RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P --------- Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
* Call rb_jit_cont_init() even earlierTakashi Kokubun2023-10-191-2/+0
| | | | To fix https://github.com/ruby/ruby/actions/runs/6581593578/job/17881779994
* Avoid initializing jit_cont_lock multiple timesTakashi Kokubun2023-10-191-3/+2
| | | | | | Contrary to my initial assumption, rb_threadptr_root_fiber_setup() is called for each Ractor, not just once at boot. I changed the place to call rb_jit_cont_init() to avoid calling it multiple times.
* YJIT: Add RubyVM::YJIT.enable (#8705)Takashi Kokubun2023-10-191-21/+8
|
* Fix support for dynamic keys. (#8273)Samuel Williams2023-08-241-5/+3
| | | * Skip RBS test.
* Move a local variable declaration after the protected regionNobuyoshi Nakada2023-08-031-1/+1
|
* Add VM_ASSERT on `fiber->blocking == 0`. (#7926)Samuel Williams2023-06-101-0/+2
| | | I have not seen any problems with this code, but this ensures the invariant.
* Allow environment variable to control madvise advice. (#7855)Samuel Williams2023-05-251-10/+28
| | | Introduce experimental support for explicitly specifying the `advice` value provided to `madvise` when releasing the fiber stack.
* Add Fiber#kill, similar to Thread#kill. (#7823)Samuel Williams2023-05-181-20/+79
|
* RJIT: Do nothing on jit_cont_freeTakashi Kokubun2023-03-091-0/+2
| | | | if cont is NULL.
* RJIT: Stop allowing leaked globals rjit_*Takashi Kokubun2023-03-081-2/+2
|
* s/mjit/rjit/Takashi Kokubun2023-03-061-3/+3
|
* Adjust `else` style to be consistent in each files [ci skip]Nobuyoshi Nakada2023-02-261-3/+6
|
* Assigning `nil` to fiber storage deletes the association. (#7378)Samuel Williams2023-02-251-7/+18
| | | Also avoid allocations when looking up `Fiber#storage` if not needed.
* Merge gc.h and internal/gc.hMatt Valentine-House2023-02-091-1/+1
| | | | [Feature #19425]
* Docs: Fix problems with Fiber's docszverok2022-12-231-13/+15
| | | | | | * References to Scheduler (was outdated to SchedulerInterface) * References between new methods (storage, [], []=) * Storage's call-sequence (rendered confusingly)
* [DOC] Fix formattingNobuyoshi Nakada2022-12-211-2/+4
|
* Use "Fiber storage variables" consistentlyBenoit Daloze2022-12-201-2/+2
|
* Improve documentation for fiber-scoped variablesBenoit Daloze2022-12-201-2/+2
| | | | * Especially around Enumerator.
* Ensure Fiber storage is only accessed from the Fiber it belongs toBenoit Daloze2022-12-201-0/+10
|
* Use an experimental warning for Fiber#storage=Benoit Daloze2022-12-201-0/+6
|
* Never use the storage of another Fiber, that violates the whole designBenoit Daloze2022-12-201-16/+1
| | | | * See https://bugs.ruby-lang.org/issues/19078#note-30
* Disable SEH workaround on __MINGW64__ only. (#6957)Samuel Williams2022-12-191-1/+1
|
* Add spec for fiber storage. (#6896)Samuel Williams2022-12-101-0/+7
|
* Introduce `Fiber#storage` for inheritable fiber-scoped variables. (#6612)Samuel Williams2022-12-011-53/+261
|
* Using UNDEF_P macroS-H-GAMELINKS2022-11-161-3/+3
|
* Lower priority of `POSIX_MADV_DONTNEED`. (#6671)Samuel Williams2022-11-041-3/+18
|
* Reuse FIBER_RESUMED_P macroS-H-GAMELINKS2022-10-311-1/+1
|
* YJIT: GC and recompile all code pages (#6406)Takashi Kokubun2022-10-251-1/+1
| | | | | when it fails to allocate a new page. Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
* MJIT: Stop using the VM barrier for jit_contTakashi Kokubun2022-10-191-13/+22
| | | | | | | | | | | | | | | | This solves multiple problems. First, RB_VM_LOCK_ENTER/LEAVE is a barrier. We could at least use the _NO_BARRIER variant. Second, this doesn't need to interfere with GC or other GVL users when multiple Ractors are used. This needs to be used in very few places, so the benefit of fine-grained locking would outweigh its small maintenance cost. Third, it fixes a crash for YJIT. Because YJIT is never disabled until a process exits unlike MJIT that finishes earlier, we could call jit_cont_free when EC no longer exists, which crashes RB_VM_LOCK_ENTER.
* Allow passing a Rust closure to rb_iseq_callback (#6575)Takashi Kokubun2022-10-181-2/+2
|
* Make mjit_cont sharable with YJIT (#6556)Takashi Kokubun2022-10-171-15/+116
| | | | | | | * Make mjit_cont sharable with YJIT * Update dependencies * Update YJIT binding
* Update `Fiber::Scheduler` documentation. (#6562)Samuel Williams2022-10-151-339/+1
|
* Improvements to IO::Buffer implementation and documentation. (#6525)Samuel Williams2022-10-121-8/+29
|
* Introduce `Fiber.blocking{}` for bypassing the fiber scheduler. (#6498)Samuel Williams2022-10-061-0/+32
|
* Try to ignore a noisy ASAN warning for continuationYusuke Endoh2022-09-201-0/+2
|
* Rename rb_ary_tmp_new to rb_ary_hidden_newPeter Zhu2022-07-261-1/+1
| | | | | | rb_ary_tmp_new suggests that the array is temporary in some way, but that's not true, it just creates an array that's hidden and not on the transient heap. This commit renames it to rb_ary_hidden_new.
* Prevent the stack from being marked twiceAaron Patterson2022-07-201-0/+6
| | | | | | | This commit prevents the stack from being marked twice: once via the Fiber, and once via the Thread. It introduces an assertion to assert that the ec on the thread is the same as the ec on the Fiber being marked via the thread.
* cont.c: prevent a warning of GCC 12.1Yusuke Endoh2022-06-131-0/+4
| | | | | | | | | | | | | | ... by assigning a dummy value to the allocated stack. http://rubyci.s3.amazonaws.com/arch/ruby-master/log/20220613T000004Z.log.html.gz ``` cont.c: In function ‘cont_restore_0.constprop’: cont.c:1489:28: warning: ‘*sp’ may be used uninitialized [-Wmaybe-uninitialized] 1489 | space[0] = *sp; | ^~~ ``` Also it adds some comments about the hack of dummy stack allocation.
* Remove unnecessary ignore warnings.Samuel Williams2022-05-261-5/+1
|
* Ensure we retain the main fiber stack bounds.Samuel Williams2022-05-251-3/+14
|
* Tidy up redundant returns.Samuel Williams2022-05-251-3/+1
|
* Add support for address sanitizer for amd64 and arm64.Samuel Williams2022-05-251-2/+40
|
* Add ISEQ_BODY macroPeter Zhu2022-03-241-1/+1
| | | | | | Use ISEQ_BODY macro to get the rb_iseq_constant_body of the ISeq. Using this macro will make it easier for us to change the allocation strategy of rb_iseq_constant_body when using Variable Width Allocation.
* Fix potential memory leak at fiber poolNobuyoshi Nakada2022-03-181-2/+2
| | | | | Do not "allocate then wrap". It leaks the allocated memory if failed to create the wrapper.
* Fix compilation error with `RB_EXPERIMENTAL_FIBER_POOL`Nobuyoshi Nakada2022-03-181-1/+4
|
* [DOC]Fix FreeBSD Bugzilla linkS-H-GAMELINKS2022-03-151-1/+1
|
* Fix conversion macro for `size_t`Nobuyoshi Nakada2022-03-131-2/+2
|
* Fix experimental Fiber::Pool definitionNobuyoshi Nakada2022-03-131-1/+1
| | | | | Toplevel `Pool` is too generic, and `struct fiber_pool` does not seem compatible with `rb_fiber_t`.
* `rb_fiber_terminate` must not return [Bug #18497]Nobuyoshi Nakada2022-01-191-1/+2
| | | | | | | | In a forked process from a fiber, the fiber becomes the only fiber, `fiber_switch` does nothing as there is no other fibers, `rb_fiber_terminate` does not terminate the fiber. In that case, reaches the end of `fiber_entry` finaly, which is declared as "COROUTINE" and should never return.