From e918a7f155648fc83ed78c8fca85e6e56b77d9ff Mon Sep 17 00:00:00 2001 From: sof Date: Tue, 25 Mar 2003 17:26:09 +0000 Subject: [PATCH] [project @ 2003-03-25 17:26:08 by sof] wibble wrt stgMallocBytes() --- ghc/rts/RtsFlags.c | 4 ++-- ghc/rts/RtsUtils.h | 4 +++- ghc/rts/Schedule.c | 9 +++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ghc/rts/RtsFlags.c b/ghc/rts/RtsFlags.c index ebd55b6..b4ce185 100644 --- a/ghc/rts/RtsFlags.c +++ b/ghc/rts/RtsFlags.c @@ -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; diff --git a/ghc/rts/RtsUtils.h b/ghc/rts/RtsUtils.h index 5a7da5a..5d1dd73 100644 --- a/ghc/rts/RtsUtils.h +++ b/ghc/rts/RtsUtils.h @@ -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 ); diff --git a/ghc/rts/Schedule.c b/ghc/rts/Schedule.c index 61cae7a..73bb620 100644 --- a/ghc/rts/Schedule.c +++ b/ghc/rts/Schedule.c @@ -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); } -- 1.7.10.4