cont.c: wrapper function
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cd36bea568
commit
d7a9f59108
10
cont.c
10
cont.c
@ -750,6 +750,7 @@ fiber_set_stack_location(void)
|
|||||||
th->ec->machine.stack_start = (void*)(((VALUE)ptr & RB_PAGE_MASK) + STACK_UPPER((void *)&ptr, 0, RB_PAGE_SIZE));
|
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
|
static VOID CALLBACK
|
||||||
fiber_entry(void *arg)
|
fiber_entry(void *arg)
|
||||||
{
|
{
|
||||||
@ -758,6 +759,13 @@ fiber_entry(void *arg)
|
|||||||
}
|
}
|
||||||
#else /* _WIN32 */
|
#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
|
* FreeBSD require a first (i.e. addr) argument of mmap(2) is not NULL
|
||||||
* if MAP_STACK is passed.
|
* if MAP_STACK is passed.
|
||||||
@ -841,7 +849,7 @@ fiber_initialize_machine_stack_context(rb_fiber_t *fib, size_t size)
|
|||||||
context->uc_stack.ss_size = size;
|
context->uc_stack.ss_size = size;
|
||||||
fib->ss_sp = ptr;
|
fib->ss_sp = ptr;
|
||||||
fib->ss_size = size;
|
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_start = (VALUE*)(ptr + STACK_DIR_UPPER(0, size));
|
||||||
sec->machine.stack_maxsize = size - RB_PAGE_SIZE;
|
sec->machine.stack_maxsize = size - RB_PAGE_SIZE;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user