Commit a0b380bb authored by rrt's avatar rrt
Browse files

[project @ 2000-04-03 15:24:21 by rrt]

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).
parent 27c9fa78
......@@ -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
......
/* -----------------------------------------------------------------------------
* $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 *
......
/* ---------------------------------------------------------------------------
* $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",
......
/* -----------------------------------------------------------------------------
* $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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment