From 638dc2ed62bb97e7a01b64716b79e9342b38e94d Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 29 Aug 2011 23:15:45 -0600 Subject: [PATCH] implement MZ_DO_NOT_INLINE() for MSVC For 64-bit builds, MSVC has become smart enough to inline functions in a way that interferes with the implementation of continuations, so that (planet "williams/simulation/examples/model-2b") crashes, for example. Explicitly disabling inlining avoids the problem by making the C stack layout match the implementation's expectation. --- src/racket/src/schpriv.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/racket/src/schpriv.h b/src/racket/src/schpriv.h index 1cefd6b408..f1368ee924 100644 --- a/src/racket/src/schpriv.h +++ b/src/racket/src/schpriv.h @@ -120,6 +120,8 @@ int scheme_num_types(void); #if MZ_USE_NOINLINE # define MZ_DO_NOT_INLINE(decl) decl __attribute__ ((noinline)); +#elif _MSC_VER +# define MZ_DO_NOT_INLINE(decl) __declspec(noinline) decl; #else # define MZ_DO_NOT_INLINE(decl) #endif