aboutsummaryrefslogtreecommitdiffstats
path: root/cont.c
diff options
context:
space:
mode:
authorsamuel <samuel@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-20 10:18:08 +0000
committersamuel <samuel@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-20 10:18:08 +0000
commitc5d3b83a9f8b6a02dff3fd6f81af03c1591cc2f6 (patch)
treec4e1f9ef7bf82bd6df2420d099220b44d2f845ad /cont.c
parent8b1b056e1c630e60ad55cee430c8aa92046b3537 (diff)
downloadruby-c5d3b83a9f8b6a02dff3fd6f81af03c1591cc2f6.tar.gz
Fix exposure of stack allocations.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c5
1 files 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;
@@ -1870,6 +1870,7 @@ rb_fiber_terminate(rb_fiber_t *fib, int need_interrupt)
fib->cont.machine.stack = NULL;
fib->cont.machine.stack_size = 0;
#endif
+#endif
ret_fib = return_fiber();
if (need_interrupt) RUBY_VM_SET_INTERRUPT(&ret_fib->cont.saved_ec);