summaryrefslogtreecommitdiff
path: root/cont.c
AgeCommit message (Collapse)Author
2024-04-24Add ruby_mimcallocPeter Zhu
Many places call ruby_mimmalloc then MEMZERO. This can be reduced by using ruby_mimcalloc instead.
2024-04-17`Fiber#raise` recursively raises on nested resuming_fiber. (#10482)Samuel Williams
* Improve consistency of `Fiber.current.raise`.
2024-04-08Enumerator should use a non-blocking fiber, change `rb_fiber_new` to be ↵Samuel Williams
non-blocking by default. (#10481)
2024-04-07Revert "Enumerator should use a non-blocking fiber. (#10478)" (#10480)Samuel Williams
This reverts commit dfa0897de89251a631a67460b941cd24a14c9b55. This commit accidentally included some change in `parse.h`. Reverting and re-applying the relevant changes.
2024-04-07Enumerator should use a non-blocking fiber. (#10478)Samuel Williams
2024-03-25Mark fiber stacks in rb_execution_context_markKJ Tsanaktsidis
Currently, fiber stacks are marked separately from the rest of the execution context. The fiber code deliberately does _NOT_ set ec->machine.stack_end on the saved EC, so that the code in `rb_execution_context_mark` does not mark it; instead, the stack marking is done in `cont_mark`. Instead, we can set ec->machine.stack_end, and skip out on doing the stack marking separately in `cont_mark`; that way, all machine stack marking shares the same code (which does the nescessary ASAN things). [Bug #20310]
2024-03-18Update set_backtrace documentationJean Boussier
Followup: https://github.com/ruby/ruby/pull/10017 [Feature #13557]
2024-03-04Disable callcc when ASAN is enabledKJ Tsanaktsidis
callcc's implementation is fundamentally incompatible with ASAN. Since callcc is deprecated and almost never used, it's probably OK to disable callcc when ruby is compiled with ASAN. [Bug #20273]
2024-01-08Adjust styles and indents [ci skip]Nobuyoshi Nakada
2023-12-22FREE_AT_EXIT: Don't free main stack post-forkJohn Hawthorn
When a forked process was started in a thread, this would result in a double-free during the child process exit. RUBY_FREE_AT_EXIT=1 ./miniruby -e 'Thread.new { fork { } }.join; Process.waitpid' This is because the main thread in the forked process was not the initial VM thread, and the new thread's stack was freed as part of objectspace iteration. This change also allows rb_threadptr_root_fiber_release to run without EC being available.
2023-12-09[DOC] Small fixes for documentation renderingVictor Shepelev
Mostly just fixing RDoc's incorrect treatment of `+`
2023-12-08Improve Fiber#kill docs and simplify the NEWS entry to let the documentation ↵Benoit Daloze
explain
2023-12-07Free everything at shutdownAdam Hess
when the RUBY_FREE_ON_SHUTDOWN environment variable is set, manually free memory at shutdown. Co-authored-by: Nobuyoshi Nakada <[email protected]> Co-authored-by: Peter Zhu <[email protected]>
2023-11-30YJIT: Cancel on-stack jit_return on invalidation (#9086)Takashi Kokubun
* YJIT: Cancel on-stack jit_return on invalidation Co-authored-by: Alan Wu <[email protected]> * Use RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P --------- Co-authored-by: Alan Wu <[email protected]>
2023-10-19Call rb_jit_cont_init() even earlierTakashi Kokubun
To fix https://github.com/ruby/ruby/actions/runs/6581593578/job/17881779994
2023-10-19Avoid initializing jit_cont_lock multiple timesTakashi Kokubun
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.
2023-10-19YJIT: Add RubyVM::YJIT.enable (#8705)Takashi Kokubun
2023-08-24Fix support for dynamic keys. (#8273)Samuel Williams
* Skip RBS test. Notes: Merged-By: ioquatix <[email protected]>
2023-08-03Move a local variable declaration after the protected regionNobuyoshi Nakada
2023-06-10Add VM_ASSERT on `fiber->blocking == 0`. (#7926)Samuel Williams
I have not seen any problems with this code, but this ensures the invariant. Notes: Merged-By: ioquatix <[email protected]>
2023-05-25Allow environment variable to control madvise advice. (#7855)Samuel Williams
Introduce experimental support for explicitly specifying the `advice` value provided to `madvise` when releasing the fiber stack. Notes: Merged-By: ioquatix <[email protected]>
2023-05-18Add Fiber#kill, similar to Thread#kill. (#7823)Samuel Williams
Notes: Merged-By: ioquatix <[email protected]>
2023-03-09RJIT: Do nothing on jit_cont_freeTakashi Kokubun
if cont is NULL.
2023-03-08RJIT: Stop allowing leaked globals rjit_*Takashi Kokubun
2023-03-06s/mjit/rjit/Takashi Kokubun
Notes: Merged: https://github.com/ruby/ruby/pull/7462
2023-02-26Adjust `else` style to be consistent in each files [ci skip]Nobuyoshi Nakada
2023-02-25Assigning `nil` to fiber storage deletes the association. (#7378)Samuel Williams
Also avoid allocations when looking up `Fiber#storage` if not needed. Notes: Merged-By: ioquatix <[email protected]>
2023-02-09Merge gc.h and internal/gc.hMatt Valentine-House
[Feature #19425] Notes: Merged: https://github.com/ruby/ruby/pull/7273
2022-12-23Docs: Fix problems with Fiber's docszverok
* References to Scheduler (was outdated to SchedulerInterface) * References between new methods (storage, [], []=) * Storage's call-sequence (rendered confusingly) Notes: Merged: https://github.com/ruby/ruby/pull/6985
2022-12-21[DOC] Fix formattingNobuyoshi Nakada
2022-12-20Use "Fiber storage variables" consistentlyBenoit Daloze
Notes: Merged: https://github.com/ruby/ruby/pull/6974
2022-12-20Improve documentation for fiber-scoped variablesBenoit Daloze
* Especially around Enumerator. Notes: Merged: https://github.com/ruby/ruby/pull/6974
2022-12-20Ensure Fiber storage is only accessed from the Fiber it belongs toBenoit Daloze
Notes: Merged: https://github.com/ruby/ruby/pull/6972
2022-12-20Use an experimental warning for Fiber#storage=Benoit Daloze
Notes: Merged: https://github.com/ruby/ruby/pull/6972
2022-12-20Never use the storage of another Fiber, that violates the whole designBenoit Daloze
* See https://bugs.ruby-lang.org/issues/19078#note-30 Notes: Merged: https://github.com/ruby/ruby/pull/6972
2022-12-19Disable SEH workaround on __MINGW64__ only. (#6957)Samuel Williams
Notes: Merged-By: ioquatix <[email protected]>
2022-12-10Add spec for fiber storage. (#6896)Samuel Williams
Notes: Merged-By: ioquatix <[email protected]>
2022-12-01Introduce `Fiber#storage` for inheritable fiber-scoped variables. (#6612)Samuel Williams
Notes: Merged-By: ioquatix <[email protected]>
2022-11-16Using UNDEF_P macroS-H-GAMELINKS
Notes: Merged: https://github.com/ruby/ruby/pull/6721
2022-11-04Lower priority of `POSIX_MADV_DONTNEED`. (#6671)Samuel Williams
Notes: Merged-By: ioquatix <[email protected]>
2022-10-31Reuse FIBER_RESUMED_P macroS-H-GAMELINKS
Notes: Merged: https://github.com/ruby/ruby/pull/6635
2022-10-25YJIT: GC and recompile all code pages (#6406)Takashi Kokubun
when it fails to allocate a new page. Co-authored-by: Alan Wu <[email protected]> Notes: Merged-By: k0kubun <[email protected]>
2022-10-19MJIT: Stop using the VM barrier for jit_contTakashi Kokubun
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.
2022-10-18Allow passing a Rust closure to rb_iseq_callback (#6575)Takashi Kokubun
Notes: Merged-By: k0kubun <[email protected]>
2022-10-17Make mjit_cont sharable with YJIT (#6556)Takashi Kokubun
* Make mjit_cont sharable with YJIT * Update dependencies * Update YJIT binding Notes: Merged-By: k0kubun <[email protected]>
2022-10-15Update `Fiber::Scheduler` documentation. (#6562)Samuel Williams
Notes: Merged-By: ioquatix <[email protected]>
2022-10-12Improvements to IO::Buffer implementation and documentation. (#6525)Samuel Williams
Notes: Merged-By: ioquatix <[email protected]>
2022-10-06Introduce `Fiber.blocking{}` for bypassing the fiber scheduler. (#6498)Samuel Williams
Notes: Merged-By: ioquatix <[email protected]>
2022-09-20Try to ignore a noisy ASAN warning for continuationYusuke Endoh
Notes: Merged: https://github.com/ruby/ruby/pull/6405
2022-07-26Rename rb_ary_tmp_new to rb_ary_hidden_newPeter Zhu
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. Notes: Merged: https://github.com/ruby/ruby/pull/6180