Commit e918a7f1 authored by sof's avatar sof
Browse files

[project @ 2003-03-25 17:26:08 by sof]

wibble wrt stgMallocBytes()
parent d139a7ae
/* -----------------------------------------------------------------------------
* $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;
......
/* -----------------------------------------------------------------------------
* $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 );
......
/* ---------------------------------------------------------------------------
* $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);
}
......
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