mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-17 16:38:14 +03:00
Fixed bug in Bench.carp where a value was used outside of its stack scope.
This commit is contained in:
parent
15ecf7cf59
commit
8059bb3c45
@ -1,7 +1,7 @@
|
||||
(load "Bench.carp")
|
||||
(use Bench)
|
||||
(load "Debug.carp")
|
||||
;;(Debug.sanitize-addresses)
|
||||
(Debug.sanitize-addresses)
|
||||
|
||||
(def n 10000)
|
||||
|
||||
|
@ -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!")))))
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user