Fixed bug in Bench.carp where a value was used outside of its stack scope.

This commit is contained in:
Erik Svedäng 2018-03-07 15:20:44 +01:00
parent 15ecf7cf59
commit 8059bb3c45
2 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
(load "Bench.carp")
(use Bench)
(load "Debug.carp")
;;(Debug.sanitize-addresses)
(Debug.sanitize-addresses)
(def n 10000)

View File

@ -57,7 +57,7 @@
n (min-one _n)
total 0.0
done false
res &(Statistics.summary &[0.0])]
res (Statistics.summary &[0.0])]
(do
(while (and (Double.< total 3000000000.0) (not done))
(let [loop-start (get-time-elapsed)
@ -74,7 +74,7 @@
(do
(set! total (Double.+ total loop-run))
(set! done true)
(set! res &summ5))
(set! res summ5))
(do
(set! total (Double.+ total loop-run))
(if (< (Double.* n 10.0) n)
@ -82,7 +82,7 @@
(set! total (Double.+ total 3000000000.0))
(set! n (Double.* n 2.0)))))))
(if done
(print-bench-results res total)
(print-bench-results &res total)
(IO.println "Could not stabilize benchmark after more than 3 seconds!")))))
)