From 44ffc9c297c8a50e08af060e89f7ebd1c4b70915 Mon Sep 17 00:00:00 2001 From: sof Date: Sun, 5 Oct 1997 20:38:58 +0000 Subject: [PATCH] [project @ 1997-10-05 20:38:58 by sof] Added hack for turning off heap check context switches if more than one thread has entered Haskell via a stable ptr (in C). x86 only --- ghc/includes/Threads.lh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ghc/includes/Threads.lh b/ghc/includes/Threads.lh index f0f88a5..48e10ef 100644 --- a/ghc/includes/Threads.lh +++ b/ghc/includes/Threads.lh @@ -45,12 +45,20 @@ extern FILE *qp_file; #endif extern I_ context_switch; /* Flag set by signal handler */ +#if defined(i386_TARGET_ARCH) +extern I_ entersFromC; /* Counter set by enterStablePtr + (see comments in c-as-asm/StablePtrOps.lc) */ +#endif #define CS_MAX_FREQUENCY 100 /* context switches per second */ #define CS_MIN_MILLISECS (1000/CS_MAX_FREQUENCY)/* milliseconds per slice */ #ifdef __STG_GCC_REGS__ -#define OR_CONTEXT_SWITCH || context_switch +# if defined(i386_TARGET_ARCH) +# define OR_CONTEXT_SWITCH || (context_switch && !entersFromC) +# else +# define OR_CONTEXT_SWITCH || context_switch +# endif #else #define OR_CONTEXT_SWITCH /* in miniInterpret */ #endif -- 1.7.10.4