[project @ 2003-03-25 17:26:08 by sof]
authorsof <unknown>
Tue, 25 Mar 2003 17:26:09 +0000 (17:26 +0000)
committersof <unknown>
Tue, 25 Mar 2003 17:26:09 +0000 (17:26 +0000)
wibble wrt stgMallocBytes()

ghc/rts/RtsFlags.c
ghc/rts/RtsUtils.h
ghc/rts/Schedule.c

index ebd55b6..b4ce185 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: RtsFlags.c,v 1.66 2003/02/22 04:51:53 sof Exp $
+ * $Id: RtsFlags.c,v 1.67 2003/03/25 17:26:08 sof Exp $
  *
  * (c) The AQUA Project, Glasgow University, 1994-1997
  * (c) The GHC Team, 1998-1999
@@ -528,7 +528,7 @@ splitRtsFlags(char *s, int *rts_argc, char *rts_argv[])
        if (c1 == c2) { break; }
        
        if (*rts_argc < MAX_RTS_ARGS-1) {
-           s = malloc(c2-c1+1);
+           s = stgMallocBytes(c2-c1+1, "RtsFlags.c:splitRtsFlags()");
            strncpy(s, c1, c2-c1);
            s[c2-c1] = '\0';
            rts_argv[(*rts_argc)++] = s;
index 5a7da5a..5d1dd73 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: RtsUtils.h,v 1.13 2003/03/19 18:56:14 sof Exp $
+ * $Id: RtsUtils.h,v 1.14 2003/03/25 17:26:09 sof Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -32,7 +32,9 @@ extern void stg_exit(I_ n) __attribute__((noreturn));
 char *time_str(void);
 char *ullong_format_string(ullong, char *, rtsBool);
 
+#ifdef PAR
 ullong   msTime(void);
+#endif
 
 #ifdef DEBUG
 extern void heapCheckFail( void );
index 61cae7a..73bb620 100644 (file)
@@ -1,5 +1,5 @@
 /* ---------------------------------------------------------------------------
- * $Id: Schedule.c,v 1.163 2003/03/19 18:41:19 sof Exp $
+ * $Id: Schedule.c,v 1.164 2003/03/25 17:26:09 sof Exp $
  *
  * (c) The GHC Team, 1998-2000
  *
@@ -1765,11 +1765,8 @@ labelThread(StgPtr tso, char *label)
 
   /* Caveat: Once set, you can only set the thread name to "" */
   len = strlen(label)+1;
-  buf = malloc(len);
-  if (buf == NULL) {
-    fprintf(stderr,"insufficient memory for labelThread!\n");
-  } else
-    strncpy(buf,label,len);
+  buf = stgMallocBytes(len * sizeof(char), "Schedule.c:labelThread()");
+  strncpy(buf,label,len);
   /* Update will free the old memory for us */
   updateThreadLabel((StgWord)tso,buf);
 }