do what you can when not in 3m
svn: r5878
This commit is contained in:
parent
6aa7b2c87d
commit
874c0331c3
|
@ -173,12 +173,14 @@
|
|||
|
||||
(define-struct (exn:fail:resource exn:fail) (resource))
|
||||
|
||||
(define 3m? (eq? '3m (system-type 'gc)))
|
||||
|
||||
(define (call-with-limits sec mb thunk)
|
||||
(let ([cust (make-custodian)]
|
||||
[ch (make-channel)]
|
||||
;; use this to copy parameter changes from the sub-thread
|
||||
[p current-preserved-thread-cell-values])
|
||||
(when mb (custodian-limit-memory cust (* mb 1024 1024) cust))
|
||||
(when (and mb 3m?) (custodian-limit-memory cust (* mb 1024 1024) cust))
|
||||
(let* ([work (parameterize ([current-custodian cust])
|
||||
(thread (lambda ()
|
||||
(channel-put ch
|
||||
|
|
|
@ -56,7 +56,10 @@
|
|||
(id 1) => 1
|
||||
(id (plus1 x)) => 1
|
||||
(loop) =err> "out of time"
|
||||
(memory 1000000) =err> "out of memory"
|
||||
--top--
|
||||
(when (eq? '3m (system-type 'gc))
|
||||
(t --eval-- (memory 1000000) =err> "out of memory"))
|
||||
--eval--
|
||||
(printf "x = ~s\n" x) => (void)
|
||||
,eof =err> "terminated"
|
||||
x =err> "terminated"
|
||||
|
@ -266,6 +269,4 @@
|
|||
(set! y 789) ; would be an error without the `set!' parameter
|
||||
y => 789
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
))
|
||||
|
|
Loading…
Reference in New Issue
Block a user