X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FRtsUtils.c;h=7d6c4a557cb2c567b55fd1611541c1bb33cfbceb;hb=bb3a29ba8290a6c19602734a56ba0f414f02c289;hp=c730d7aec4e97b82810b55ebc02cc746effcbb90;hpb=0dfcd5776f3ef89ceaafef6c4730ddac759e3716;p=ghc-hetmet.git diff --git a/rts/RtsUtils.c b/rts/RtsUtils.c index c730d7a..7d6c4a5 100644 --- a/rts/RtsUtils.c +++ b/rts/RtsUtils.c @@ -13,11 +13,19 @@ #include "RtsFlags.h" #include "RtsUtils.h" #include "Ticky.h" +#include "Schedule.h" #ifdef HAVE_TIME_H #include #endif +/* HACK: On Mac OS X 10.4 (at least), time.h doesn't declare ctime_r with + * _POSIX_C_SOURCE. If this is the case, we declare it ourselves. + */ +#if HAVE_CTIME_R && !HAVE_DECL_CTIME_R +extern char *ctime_r(const time_t *, char *); +#endif + #ifdef HAVE_FCNTL_H #include #endif @@ -265,15 +273,14 @@ stackOverflow(void) void heapOverflow(void) { - /* don't fflush(stdout); WORKAROUND bug in Linux glibc */ - OutOfHeapHook(0/*unknown request size*/, - RtsFlags.GcFlags.maxHeapSize * BLOCK_SIZE); - -#if defined(TICKY_TICKY) - if (RtsFlags.TickyFlags.showTickyStats) PrintTickyInfo(); -#endif + if (!heap_overflow) + { + /* don't fflush(stdout); WORKAROUND bug in Linux glibc */ + OutOfHeapHook(0/*unknown request size*/, + RtsFlags.GcFlags.maxHeapSize * BLOCK_SIZE); - stg_exit(EXIT_HEAPOVERFLOW); + heap_overflow = rtsTrue; + } } /* -----------------------------------------------------------------------------