| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
* Make mjit_cont sharable with YJIT
* Update dependencies
* Update YJIT binding
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
... 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.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Do not "allocate then wrap". It leaks the allocated memory if
failed to create the wrapper.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Toplevel `Pool` is too generic, and `struct fiber_pool` does not
seem compatible with `rb_fiber_t`.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
`timeout_after`.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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);
| ^~~~~~~
```
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Must not be a bad idea to improve documents.
|
| |
|
| |
|
|
|
|
| |
It has not been used since 1b82c877dfa72e8505ded149fd0e3ba956529d3f.
|
| |
|
| |
|
|
|
|
| |
* --procnames-start-lines
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
it is more about memory accounting sake. At allocation time,
we make clear we re possibly reusing regions marked as reusable.
Noted also calls might not necessarily succeed at first so we do
only when necessary.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this patch, TracePoint receives a `:fiber_switch` event for
_almost_ every fiber switch. Previously, it would not be sent when an
exception was going to be raised. Now the event should only be blockable
by an interrupt (including `Thread#raise`) or a fatal error.
Additionally, interrupts will now be checked on the return fiber
_before_ re-raising the terminating unhandled exception. And a fiber
that terminates with an unhandled exception no longer creates a pending
interrupt on its thread. The exception will be raised in the return
fiber the same way as `Fiber#raise`: using `cont.value` with `cont.argc
== -1`
I moved `rb_exc_raise` from `fiber_store` to the end of `fiber_switch`
after _all_ of the other cleanup code: `fiber_stack_release`,
`th->blocking` increment, `RUBY_VM_CHECK_INTS`, and `EXEC_EVENT_HOOK`.
It seems to me that skipping those other cleanup steps may have also
resulted in other bugs.
|
|
|
|
|
|
|
|
|
| |
* Rename `rb_scheduler` to `rb_fiber_scheduler`.
* Use public interface if available.
* Use `rb_check_funcall` where possible.
* Don't use `unblock` unless the fiber was non-blocking.
|