зеркало из https://github.com/github/ruby.git
Remove root_jmpbuf in rb_thread_struct
It has not been used since 1b82c877df
.
This commit is contained in:
Родитель
42b6dc84d3
Коммит
28d03ee776
2
cont.c
2
cont.c
|
@ -711,8 +711,6 @@ fiber_pool_stack_release(struct fiber_pool_stack * stack)
|
|||
#endif
|
||||
}
|
||||
|
||||
void rb_fiber_start(rb_fiber_t*);
|
||||
|
||||
static inline void
|
||||
ec_switch(rb_thread_t *th, rb_fiber_t *fiber)
|
||||
{
|
||||
|
|
3
eval.c
3
eval.c
|
@ -1112,17 +1112,14 @@ rb_protect(VALUE (* proc) (VALUE), VALUE data, int *pstate)
|
|||
volatile enum ruby_tag_type state;
|
||||
rb_execution_context_t * volatile ec = GET_EC();
|
||||
rb_control_frame_t *volatile cfp = ec->cfp;
|
||||
rb_jmpbuf_t org_jmpbuf;
|
||||
|
||||
EC_PUSH_TAG(ec);
|
||||
MEMCPY(&org_jmpbuf, &rb_ec_thread_ptr(ec)->root_jmpbuf, rb_jmpbuf_t, 1);
|
||||
if ((state = EC_EXEC_TAG()) == TAG_NONE) {
|
||||
SAVE_ROOT_JMPBUF(rb_ec_thread_ptr(ec), result = (*proc) (data));
|
||||
}
|
||||
else {
|
||||
rb_vm_rewind_cfp(ec, cfp);
|
||||
}
|
||||
MEMCPY(&rb_ec_thread_ptr(ec)->root_jmpbuf, &org_jmpbuf, rb_jmpbuf_t, 1);
|
||||
EC_POP_TAG();
|
||||
|
||||
if (pstate != NULL) *pstate = state;
|
||||
|
|
|
@ -91,40 +91,12 @@ extern int select_large_fdset(int, fd_set *, fd_set *, fd_set *, struct timeval
|
|||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define SAVE_ROOT_JMPBUF_BEFORE_STMT \
|
||||
__try {
|
||||
#define SAVE_ROOT_JMPBUF_AFTER_STMT \
|
||||
} \
|
||||
__except (GetExceptionCode() == EXCEPTION_STACK_OVERFLOW ? \
|
||||
(rb_ec_raised_set(GET_EC(), RAISED_STACKOVERFLOW), \
|
||||
raise(SIGSEGV), \
|
||||
EXCEPTION_EXECUTE_HANDLER) : \
|
||||
EXCEPTION_CONTINUE_SEARCH) { \
|
||||
/* never reaches here */ \
|
||||
}
|
||||
#elif defined(__MINGW32__)
|
||||
LONG WINAPI rb_w32_stack_overflow_handler(struct _EXCEPTION_POINTERS *);
|
||||
#define SAVE_ROOT_JMPBUF_BEFORE_STMT \
|
||||
do { \
|
||||
PVOID _handler = AddVectoredExceptionHandler(1, rb_w32_stack_overflow_handler);
|
||||
|
||||
#define SAVE_ROOT_JMPBUF_AFTER_STMT \
|
||||
RemoveVectoredExceptionHandler(_handler); \
|
||||
} while (0);
|
||||
#else
|
||||
#define SAVE_ROOT_JMPBUF_BEFORE_STMT
|
||||
#define SAVE_ROOT_JMPBUF_AFTER_STMT
|
||||
#endif
|
||||
|
||||
#define SAVE_ROOT_JMPBUF(th, stmt) do \
|
||||
if (ruby_setjmp((th)->root_jmpbuf) == 0) { \
|
||||
SAVE_ROOT_JMPBUF_BEFORE_STMT \
|
||||
if (true) { \
|
||||
stmt; \
|
||||
SAVE_ROOT_JMPBUF_AFTER_STMT \
|
||||
} \
|
||||
else { \
|
||||
rb_fiber_start(th->ec->fiber_ptr); \
|
||||
else if (th) { /* suppress unused-variable warning */ \
|
||||
} while (0)
|
||||
|
||||
#define EC_PUSH_TAG(ec) do { \
|
||||
|
|
|
@ -1023,7 +1023,6 @@ typedef struct rb_thread_struct {
|
|||
|
||||
/* fiber */
|
||||
rb_fiber_t *root_fiber;
|
||||
rb_jmpbuf_t root_jmpbuf;
|
||||
|
||||
VALUE scheduler;
|
||||
unsigned blocking;
|
||||
|
|
Загрузка…
Ссылка в новой задаче