Don't set memory limits or test for them when there is no memory
accounting. svn: r12839
This commit is contained in:
parent
813eb20e35
commit
39a69b30fd
|
@ -670,7 +670,7 @@
|
|||
out)]
|
||||
[else (error 'make-evaluator "bad sandox-~a spec: ~e" what out)]))
|
||||
;; set global memory limit
|
||||
(when (sandbox-memory-limit)
|
||||
(when (and memory-accounting? (sandbox-memory-limit))
|
||||
(custodian-limit-memory
|
||||
memory-cust (* (sandbox-memory-limit) 1024 1024) memory-cust))
|
||||
(parameterize* ; the order in these matters
|
||||
|
|
|
@ -146,12 +146,13 @@
|
|||
(set! ev (parameterize ([sandbox-eval-limits '(0.25 5)])
|
||||
(make-evaluator 'scheme/base '(sleep 2))))
|
||||
=err> "out of time"
|
||||
(when (custodian-memory-accounting-available?)
|
||||
(set! ev (parameterize ([sandbox-eval-limits '(0.25 2)])
|
||||
(make-evaluator 'scheme/base
|
||||
'(define a (for/list ([i (in-range 10)])
|
||||
(collect-garbage)
|
||||
(make-string 1000))))))
|
||||
=err> "out of memory"
|
||||
(t --top-- =err> "out of memory"))
|
||||
|
||||
;; i/o
|
||||
--top--
|
||||
|
@ -456,6 +457,8 @@
|
|||
|
||||
;; when an expression is out of memory, the sandbox should stay alive
|
||||
--top--
|
||||
(when (custodian-memory-accounting-available?)
|
||||
(t --top--
|
||||
(set! ev (parameterize ([sandbox-eval-limits '(2 5)]
|
||||
[sandbox-memory-limit 100])
|
||||
(make-evaluator 'scheme/base)))
|
||||
|
@ -466,7 +469,7 @@
|
|||
(set! a (cons (make-bytes 500000) a))
|
||||
(collect-garbage))
|
||||
=err> "out of memory"
|
||||
b => 1
|
||||
b => 1))
|
||||
|
||||
))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user