From c5d3b83a9f8b6a02dff3fd6f81af03c1591cc2f6 Mon Sep 17 00:00:00 2001 From: samuel Date: Tue, 20 Nov 2018 10:18:08 +0000 Subject: Fix exposure of stack allocations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- cont.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cont.c b/cont.c index 7e82b84d80..b76af31850 100644 --- a/cont.c +++ b/cont.c @@ -179,7 +179,7 @@ fiber_context_create(ucontext_t *context, void (*func)(), void *arg, void *ptr, } #endif -#if FIBER_USE_NATIVE +#if FIBER_USE_NATIVE && !defined(_WIN32) #define MAX_MACHINE_STACK_CACHE 10 static int machine_stack_cache_index = 0; typedef struct machine_stack_cache_struct { @@ -1861,7 +1861,7 @@ rb_fiber_terminate(rb_fiber_t *fib, int need_interrupt) #elif !defined(_WIN32) fib->context.uc_stack.ss_sp = NULL; #endif -#endif + #ifdef MAX_MACHINE_STACK_CACHE /* Ruby must not switch to other thread until storing terminated_machine_stack */ terminated_machine_stack.ptr = fib->ss_sp; @@ -1869,6 +1869,7 @@ rb_fiber_terminate(rb_fiber_t *fib, int need_interrupt) fib->ss_sp = NULL; fib->cont.machine.stack = NULL; fib->cont.machine.stack_size = 0; +#endif #endif ret_fib = return_fiber(); -- cgit v1.2.3