projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5fe8671
)
[project @ 1997-10-09 09:08:06 by simonm]
author
simonm
<unknown>
Thu, 9 Oct 1997 09:08:06 +0000
(09:08 +0000)
committer
simonm
<unknown>
Thu, 9 Oct 1997 09:08:06 +0000
(09:08 +0000)
Avoid divide by zero if the measured elapsed time is 0.00 seconds.
ghc/runtime/storage/SMstats.lc
patch
|
blob
|
history
diff --git
a/ghc/runtime/storage/SMstats.lc
b/ghc/runtime/storage/SMstats.lc
index
b10db26
..
f67c4e7
100644
(file)
--- a/
ghc/runtime/storage/SMstats.lc
+++ b/
ghc/runtime/storage/SMstats.lc
@@
-456,6
+456,11
@@
stat_exit(I_ alloc)
StgDouble time = usertime();
StgDouble etime = elapsedtime();
+ /* avoid divide by zero if time is measured as 0.00 seconds -- SDM */
+ if (time == 0.0) time = 0.0001;
+ if (etime == 0.0) etime = 0.0001;
+
+
if (RTSflags.GcFlags.giveStats) {
fprintf(sf, "%8ld\n\n", alloc*sizeof(W_));
}