ruby-changes:51145
From: nobu <ko1@a...>
Date: Tue, 8 May 2018 08:52:53 +0900 (JST)
Subject: [ruby-changes:51145] nobu:r63352 (trunk): cont.c: wrapper function
nobu 2018-05-08 08:52:48 +0900 (Tue, 08 May 2018) New Revision: 63352 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63352 Log: cont.c: wrapper function Modified files: trunk/cont.c Index: cont.c =================================================================== --- cont.c (revision 63351) +++ cont.c (revision 63352) @@ -750,6 +750,7 @@ fiber_set_stack_location(void) https://github.com/ruby/ruby/blob/trunk/cont.c#L750 th->ec->machine.stack_start = (void*)(((VALUE)ptr & RB_PAGE_MASK) + STACK_UPPER((void *)&ptr, 0, RB_PAGE_SIZE)); } +NORETURN(static VOID CALLBACK fiber_entry(void *arg)); static VOID CALLBACK fiber_entry(void *arg) { @@ -758,6 +759,13 @@ fiber_entry(void *arg) https://github.com/ruby/ruby/blob/trunk/cont.c#L759 } #else /* _WIN32 */ +NORETURN(static void fiber_entry(void *arg)); +static void +fiber_entry(void *arg) +{ + rb_fiber_start(); +} + /* * FreeBSD require a first (i.e. addr) argument of mmap(2) is not NULL * if MAP_STACK is passed. @@ -841,7 +849,7 @@ fiber_initialize_machine_stack_context(r https://github.com/ruby/ruby/blob/trunk/cont.c#L849 context->uc_stack.ss_size = size; fib->ss_sp = ptr; fib->ss_size = size; - makecontext(context, rb_fiber_start, 0); + makecontext(context, fiber_entry, 0); sec->machine.stack_start = (VALUE*)(ptr + STACK_DIR_UPPER(0, size)); sec->machine.stack_maxsize = size - RB_PAGE_SIZE; #endif -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/