[project @ 2000-04-03 15:24:21 by rrt]
authorrrt <unknown>
Mon, 3 Apr 2000 15:24:21 +0000 (15:24 +0000)
committerrrt <unknown>
Mon, 3 Apr 2000 15:24:21 +0000 (15:24 +0000)
Stopped getourtimeofday() being called under mingwin.
MBlock.c: changed one instance of 128 * 1024 * 1024 into SIZE_RESERVED_POOL
and added a TODO comment (bug in is_heap_alloced(), which won't work if
more than one megablock is ever allocated).

ghc/rts/Evaluator.c
ghc/rts/MBlock.c
ghc/rts/Schedule.c
ghc/rts/Select.c

index 4aa5dcf..b7906f7 100644 (file)
@@ -5,8 +5,8 @@
  * Copyright (c) 1994-1998.
  *
  * $RCSfile: Evaluator.c,v $
- * $Revision: 1.45 $
- * $Date: 2000/03/20 15:49:56 $
+ * $Revision: 1.46 $
+ * $Date: 2000/04/03 15:24:21 $
  * ---------------------------------------------------------------------------*/
 
 #include "Rts.h"
@@ -530,7 +530,7 @@ StgThreadReturnCode enter( Capability* cap, StgClosure* obj0 )
           cap->rCurrentTSO->why_blocked = BlockedOnDelay;
           ACQUIRE_LOCK(&sched_mutex);
           
-#if defined(HAVE_SETITIMER)
+#if defined(HAVE_SETITIMER) || defined(mingw32_TARGET_OS)
           cap->rCurrentTSO->block_info.delay 
             = hugsBlock.delay + ticks_since_select;
 #else
index 5054760..c0a619f 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: MBlock.c,v 1.14 2000/01/22 12:06:43 simonmar Exp $
+ * $Id: MBlock.c,v 1.15 2000/04/03 15:24:21 rrt Exp $
  *
  * (c) The GHC Team 1998-1999
  *
@@ -152,11 +152,12 @@ char* base_non_committed = (char*)0;
 #define SIZE_RESERVED_POOL  ( 128 * 1024 * 1024 )
 
 /* This predicate should be inlined, really. */
+/* TODO: this only works for a single chunk */
 int
 is_heap_alloced(const void* x)
 {
   return (((char*)(x) >= base_non_committed) && 
-          ((char*)(x) <= (base_non_committed + 128 * 1024 * 1024)));
+          ((char*)(x) <= (base_non_committed + SIZE_RESERVED_POOL)));
 }
 
 void *
index c0de8b0..413bfa8 100644 (file)
@@ -1,5 +1,5 @@
 /* ---------------------------------------------------------------------------
- * $Id: Schedule.c,v 1.60 2000/03/31 03:09:36 hwloidl Exp $
+ * $Id: Schedule.c,v 1.61 2000/04/03 15:24:21 rrt Exp $
  *
  * (c) The GHC Team, 1998-2000
  *
@@ -2893,7 +2893,7 @@ printThreadBlockage(StgTSO *tso)
     fprintf(stderr,"blocked on write to fd %d", tso->block_info.fd);
     break;
   case BlockedOnDelay:
-#if defined(HAVE_SETITIMER)
+#if defined(HAVE_SETITIMER) || defined(mingw32_TARGET_OS)
     fprintf(stderr,"blocked on delay of %d ms", tso->block_info.delay);
 #else
     fprintf(stderr,"blocked on delay of %d ms", 
index 49c84ff..79b21ba 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Select.c,v 1.11 2000/03/23 12:02:38 simonmar Exp $
+ * $Id: Select.c,v 1.12 2000/04/03 15:24:21 rrt Exp $
  *
  * (c) The GHC Team 1995-1999
  *
@@ -107,7 +107,7 @@ awaitEvent(rtsBool wait)
        case BlockedOnDelay:
          {
            int candidate; /* signed int is intentional */
-#if defined(HAVE_SETITIMER)
+#if defined(HAVE_SETITIMER) || defined(mingw32_TARGET_OS)
            candidate = tso->block_info.delay;
 #else
            candidate = tso->block_info.target - getourtimeofday();
@@ -222,7 +222,7 @@ awaitEvent(rtsBool wait)
        
        case BlockedOnDelay:
          {
-#if defined(HAVE_SETITIMER)
+#if defined(HAVE_SETITIMER) || defined(mingw32_TARGET_OS)
            if (tso->block_info.delay > delta) {
              tso->block_info.delay -= delta;
              ready = 0;