summaryrefslogtreecommitdiff
path: root/cont.c
AgeCommit message (Collapse)Author
2025-10-09Backport WASI setjmp handler memory leak fixes to Ruby 3.4 (#14788)刘皓
[Bug #21626]
2024-12-25[DOC] Hide Fiber::PoolNobuyoshi Nakada
It is experimental yet and is disabled currently. Notes: Merged: https://github.com/ruby/ruby/pull/12462
2024-12-23[Bug #20978] Stringize Fiber storage keysNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12438
2024-12-20FREE_AT_EXIT: Free all allocations from fiber poolJohn Hawthorn
The fiber pool allocations form a singly-linked list, so when we're running with RUBY_FREE_AT_EXIT we need to walk the linked list freeing each element, otherwise it can be detected as a memory leak. Notes: Merged: https://github.com/ruby/ruby/pull/12405
2024-12-18Get rid of duplicate modifier for MSVCNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12383
2024-11-27Mark `fiber_entry` no-returnNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/12176
2024-11-21Annotate anonymous mmapKunshan Wang
Use PR_SET_VMA_ANON_NAME to set human-readable names for anonymous virtual memory areas mapped by `mmap()` when compiled and run on Linux 5.17 or higher. This makes it convenient for developers to debug mmap. Notes: Merged: https://github.com/ruby/ruby/pull/12119
2024-07-30Revert 28a1c4f33e3349a98c04b8e068d9c674eb936064Yusuke Endoh
28a1c4f33e3349a98c04b8e068d9c674eb936064 seems to call an improper ensure clause. [Bug #20655] Than fixing it properly, I bet it would be much better to simply revert that commit. It reduces the unneeded complexity. Jumping into a block called by a C function like Hash#each with callcc is user's fault. It does not need serious support. Notes: Merged: https://github.com/ruby/ruby/pull/11254
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 <nobu@ruby-lang.org> Co-authored-by: Peter Zhu <peter@peterzhu.ca>
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 <alansi.xingwu@shopify.com> * Use RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P --------- Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
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 <samuel@codeotaku.com>
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 <samuel@codeotaku.com>
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 <samuel@codeotaku.com>
2023-05-18Add Fiber#kill, similar to Thread#kill. (#7823)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
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 <samuel@codeotaku.com>
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 <samuel@codeotaku.com>
2022-12-10Add spec for fiber storage. (#6896)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-12-01Introduce `Fiber#storage` for inheritable fiber-scoped variables. (#6612)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
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 <samuel@codeotaku.com>
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 <alansi.xingwu@shopify.com> Notes: Merged-By: k0kubun <takashikkbn@gmail.com>