projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2001-10-26 11:33:13 by sewardj]
[ghc-hetmet.git]
/
ghc
/
rts
/
RtsUtils.c
diff --git
a/ghc/rts/RtsUtils.c
b/ghc/rts/RtsUtils.c
index
5e53b7d
..
a8ce114
100644
(file)
--- a/
ghc/rts/RtsUtils.c
+++ b/
ghc/rts/RtsUtils.c
@@
-1,5
+1,5
@@
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
- * $Id: RtsUtils.c,v 1.13 2000/01/13 14:34:04 hwloidl Exp $
+ * $Id: RtsUtils.c,v 1.22 2001/08/29 15:02:02 sewardj Exp $
*
* (c) The GHC Team, 1998-1999
*
*
* (c) The GHC Team, 1998-1999
*
@@
-7,6
+7,9
@@
*
* ---------------------------------------------------------------------------*/
*
* ---------------------------------------------------------------------------*/
+/* gettimeofday isn't POSIX */
+/* #include "PosixSource.h" */
+
#include "Rts.h"
#include "RtsTypes.h"
#include "RtsAPI.h"
#include "Rts.h"
#include "RtsTypes.h"
#include "RtsAPI.h"
@@
-109,11
+112,22
@@
stgReallocWords (void *p, int n, char *msg)
return(stgReallocBytes(p, n * sizeof(W_), msg));
}
return(stgReallocBytes(p, n * sizeof(W_), msg));
}
+void *
+stgCallocBytes (int n, int m, char *msg)
+{
+ int i;
+ int sz = n * m;
+ char* p = stgMallocBytes(sz, msg);
+ for (i = 0; i < sz; i++) p[i] = 0;
+ return p;
+}
+
void
void
-_stgAssert (char *filename, nat linenum)
+_stgAssert (char *filename, unsigned int linenum)
{
{
- /* don't fflush(stdout); WORKAROUND bug in Linux glibc */
+ fflush(stdout);
fprintf(stderr, "ASSERTION FAILED: file %s, line %u\n", filename, linenum);
fprintf(stderr, "ASSERTION FAILED: file %s, line %u\n", filename, linenum);
+ fflush(stderr);
abort();
}
abort();
}
@@
-215,7
+229,7
@@
resetNonBlockingFd(int fd)
{
long fd_flags;
{
long fd_flags;
-#if !defined(_WIN32) || defined(__CYGWIN__) || defined(__CYGWIN32__)
+#if !defined(mingw32_TARGET_OS)
/* clear the non-blocking flag on this file descriptor */
fd_flags = fcntl(fd, F_GETFL);
if (fd_flags & O_NONBLOCK) {
/* clear the non-blocking flag on this file descriptor */
fd_flags = fcntl(fd, F_GETFL);
if (fd_flags & O_NONBLOCK) {
@@
-224,14
+238,13
@@
resetNonBlockingFd(int fd)
#endif
}
#endif
}
-#if 0
static ullong startTime = 0;
/* used in a parallel setup */
ullong
msTime(void)
{
static ullong startTime = 0;
/* used in a parallel setup */
ullong
msTime(void)
{
-# if defined(HAVE_GETCLOCK) && !defined(alpha_TARGET_ARCH)
+# if defined(HAVE_GETCLOCK) && !defined(alpha_TARGET_ARCH) && !defined(hppa1_1_TARGET_ARCH)
struct timespec tv;
if (getclock(TIMEOFDAY, &tv) != 0) {
struct timespec tv;
if (getclock(TIMEOFDAY, &tv) != 0) {
@@
-259,8
+272,6
@@
msTime(void)
return t * LL(1000) - startTime;
# endif
}
return t * LL(1000) - startTime;
# endif
}
-#endif
-
/* -----------------------------------------------------------------------------
Print large numbers, with punctuation.
/* -----------------------------------------------------------------------------
Print large numbers, with punctuation.