[project @ 2003-07-30 10:38:42 by simonmar]
[ghc-hetmet.git] / ghc / rts / RtsUtils.c
index 64b7758..8f6579c 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: RtsUtils.c,v 1.30 2003/03/19 18:41:19 sof Exp $
+ * $Id: RtsUtils.c,v 1.34 2003/04/01 15:40:27 sof Exp $
  *
  * (c) The GHC Team, 1998-2002
  *
@@ -109,18 +109,6 @@ stgReallocBytes (void *p, int n, char *msg)
 }
 
 void *
-stgMallocWords (int n, char *msg)
-{
-  return(stgMallocBytes(n * sizeof(W_), msg));
-}
-
-void *
-stgReallocWords (void *p, int n, char *msg)
-{
-  return(stgReallocBytes(p, n * sizeof(W_), msg));
-}
-
-void *
 stgCallocBytes (int n, int m, char *msg)
 {
   int   i;
@@ -130,6 +118,15 @@ stgCallocBytes (int n, int m, char *msg)
   return p;
 }
 
+/* To simplify changing the underlying allocator used
+ * by stgMallocBytes(), provide stgFree() as well.
+ */
+void
+stgFree(void* p)
+{
+  free(p);
+}
+
 void 
 _stgAssert (char *filename, unsigned int linenum)
 {
@@ -255,11 +252,14 @@ setNonBlockingFd(int fd)
   fcntl(fd, F_SETFL, fd_flags | O_NONBLOCK);
 }
 #else
-/* Don't support non-blocking FDs (yet) on mingw */
+/* Stub defns -- async / non-blocking IO is not done 
+ * via O_NONBLOCK and select() under Win32. 
+ */
 void resetNonBlockingFd(int fd STG_UNUSED) {}
 void setNonBlockingFd(int fd STG_UNUSED) {}
 #endif
 
+#ifdef PAR
 static ullong startTime = 0;
 
 /* used in a parallel setup */
@@ -294,6 +294,7 @@ msTime(void)
     return t * LL(1000) - startTime;
 # endif
 }
+#endif /* PAR */
 
 /* -----------------------------------------------------------------------------
    Print large numbers, with punctuation.