summaryrefslogtreecommitdiff
path: root/cont.c
AgeCommit message (Collapse)Author
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>
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 <takashikkbn@gmail.com>
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 <takashikkbn@gmail.com>
2022-10-15Update `Fiber::Scheduler` documentation. (#6562)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-10-12Improvements to IO::Buffer implementation and documentation. (#6525)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-10-06Introduce `Fiber.blocking{}` for bypassing the fiber scheduler. (#6498)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
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
2022-07-20Prevent the stack from being marked twiceAaron Patterson
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. Notes: Merged: https://github.com/ruby/ruby/pull/6123
2022-06-13cont.c: prevent a warning of GCC 12.1Yusuke Endoh
... 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. Notes: Merged: https://github.com/ruby/ruby/pull/6010
2022-05-26Remove unnecessary ignore warnings.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5947
2022-05-25Ensure we retain the main fiber stack bounds.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5940
2022-05-25Tidy up redundant returns.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5926
2022-05-25Add support for address sanitizer for amd64 and arm64.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5926
2022-03-24Add ISEQ_BODY macroPeter Zhu
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. Notes: Merged: https://github.com/ruby/ruby/pull/5698
2022-03-18Fix potential memory leak at fiber poolNobuyoshi Nakada
Do not "allocate then wrap". It leaks the allocated memory if failed to create the wrapper. Notes: Merged: https://github.com/ruby/ruby/pull/5668
2022-03-18Fix compilation error with `RB_EXPERIMENTAL_FIBER_POOL`Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5668
2022-03-15[DOC]Fix FreeBSD Bugzilla linkS-H-GAMELINKS
Notes: Merged: https://github.com/ruby/ruby/pull/5658
2022-03-13Fix conversion macro for `size_t`Nobuyoshi Nakada
2022-03-13Fix experimental Fiber::Pool definitionNobuyoshi Nakada
Toplevel `Pool` is too generic, and `struct fiber_pool` does not seem compatible with `rb_fiber_t`.
2022-01-19`rb_fiber_terminate` must not return [Bug #18497]Nobuyoshi Nakada
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. Notes: Merged: https://github.com/ruby/ruby/pull/5468
2022-01-01Negative RBOOL usageNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5385
2021-12-21Tidy up fiber scheduler interface documentation for `address_resolve` and ↵Samuel Williams
`timeout_after`. Notes: Merged: https://github.com/ruby/ruby/pull/5315
2021-12-21Update cont.cSamuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/5280
2021-12-21Add SchedulerInterface#timeout_after and #address_resolve docszverok
Notes: Merged: https://github.com/ruby/ruby/pull/5280
2021-12-21Document Fiber::SchedulerInterface#io_read and #io_writezverok
Notes: Merged: https://github.com/ruby/ruby/pull/5280
2021-11-30Fix conflicting declaration on SolarisNobuyoshi Nakada
SunC ``` "cont.c", line 24: identifier redeclared: madvise current : function(pointer to char, unsigned int, int) returning int previous: function(pointer to void, unsigned int, int) returning int : "/usr/include/sys/mman.h", line 232 ``` GCC ``` cont.c:24:12: error: conflicting types for 'madvise' 24 | extern int madvise(caddr_t, size_t, int); | ^~~~~~~ In file included from cont.c:16: /usr/include/sys/mman.h:232:12: note: previous declaration of 'madvise' was here 232 | extern int madvise(void *, size_t, int); | ^~~~~~~ ```
2021-11-30Workaround for implicit declaration of function 'madvise' on SolarisNaohisa Goto
On Solaris, madvise(3C) is NOT defined for SUS (XPG4v2) or later, but MADV_* macros are defined when __EXTENSIONS__ is defined. This may cause compile error on Solaris 10 with GCC when "-Werror=implicit-function-declaration" and "-D_XOPEN_SOURCE=600" are added by configure.
2021-09-30rb_fiber_raise(): add doxygen卜部昌平
Must not be a bad idea to improve documents. Notes: Merged: https://github.com/ruby/ruby/pull/4912
2021-09-20Expose `rb_fiber_raise` and tidy up the internal implementation.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/4649