add and use close-eval to reduce memory use when rendering reference and guide

svn: r9981

original commit: 7ae0f500ae236de71c68feec7ea727818a3b6220
This commit is contained in:
Matthew Flatt 2008-05-27 17:20:24 +00:00
parent e7d056b02d
commit ef294e47b4
2 changed files with 12 additions and 0 deletions

View File

@ -23,6 +23,7 @@
as-examples
make-base-eval
close-eval
scribble-eval-handler)
@ -244,6 +245,10 @@
[sandbox-eval-limits #f]
[sandbox-make-inspector current-inspector])
(make-evaluator '(begin (require scheme/base)))))
(define (close-eval e)
(kill-evaluator e)
"")
(define (do-plain-eval ev s catching-exns?)
(call-with-values (lambda ()

View File

@ -93,6 +93,13 @@ setting sandbox parameters to disable limits, set the outputs to
@scheme['string], and not add extra security guards.}
@defproc[(close-eval [eval (any/c . -> . any)]) (one-of/c "")]{
Shuts down an evaluator produced by @scheme[make-base-eval]. Use
@scheme[close-eval] when garbage collection cannot otherwise reclaim
an evaluator (e.g., because it is defined in a module body).}
@defparam[scribble-eval-handler handler
((any/c . -> . any) any/c boolean? . -> . any)]{