Fixing a safe-for-space error that Robby found

This commit is contained in:
Jay McCarthy 2012-02-28 14:14:26 -07:00
parent eb0e188b63
commit ffcda4741f
5 changed files with 39 additions and 13 deletions

View File

@ -145,16 +145,21 @@
(syntax/loc stx
(let*-values ([(tmp ...)
(syntax-parameterize ([mutator-env-roots
(list* #'previous-tmp ...
(syntax-parameter-value #'mutator-env-roots))]
(append
(find-referenced-locals
(list #'previous-tmp ...)
#'expr)
(syntax-parameter-value #'mutator-env-roots))]
[mutator-tail-call? #f])
expr)]
...)
(let-values ([(id ...) (values tmp ...)]
...)
(syntax-parameterize ([mutator-env-roots
(list* #'id ... ...
(syntax-parameter-value #'mutator-env-roots))])
(append (find-referenced-locals
(list #'id ... ...)
#'body-expr)
(syntax-parameter-value #'mutator-env-roots))])
(->address body-expr))))))))]
[(_ ([(id ...) expr]
...)
@ -185,8 +190,11 @@
(let ([closure
(lambda (free-id ... id ...)
(syntax-parameterize ([mutator-env-roots
(list #'id ...
#'free-id ...)]
(append
(find-referenced-locals
(list #'id ...)
#'body)
(list #'free-id ...))]
[mutator-tail-call? #t])
(->address body)))])
closure))])

View File

@ -145,16 +145,21 @@
(syntax/loc stx
(let*-values ([(tmp ...)
(syntax-parameterize ([mutator-env-roots
(list* #'previous-tmp ...
(syntax-parameter-value #'mutator-env-roots))]
(append
(find-referenced-locals
(list #'previous-tmp ...)
#'expr)
(syntax-parameter-value #'mutator-env-roots))]
[mutator-tail-call? #f])
expr)]
...)
(let-values ([(id ...) (values tmp ...)]
...)
(syntax-parameterize ([mutator-env-roots
(list* #'id ... ...
(syntax-parameter-value #'mutator-env-roots))])
(append (find-referenced-locals
(list #'id ... ...)
#'body-expr)
(syntax-parameter-value #'mutator-env-roots))])
(->address body-expr))))))))]
[(_ ([(id ...) expr]
...)
@ -181,8 +186,11 @@
(quasisyntax/loc stx
(let ([closure (lambda (id ...)
(syntax-parameterize ([mutator-env-roots
(list #'id ...
#'free-id ...)]
(append
(find-referenced-locals
(list #'id ...)
#'body)
(list #'free-id ...))]
[mutator-tail-call? #t])
(->address body)))])
(add-closure-env! closure (list (make-env-root free-id) ...))

View File

@ -0,0 +1,5 @@
#lang plai/mutator
(allocator-setup "../good-collectors/good-collector.rkt" 7)
(let ([x (cons 1 2)])
(let ([y (cons 3 4)])
y))

View File

@ -0,0 +1,5 @@
#lang plai/gc2/mutator
(allocator-setup "../good-collectors/good-collector.rkt" 7)
(let ([x (cons 1 2)])
(let ([y (cons 3 4)])
y))

View File

@ -15,7 +15,7 @@
; Finally it runs the sample tests distributed with the assignment
(allocator-setup "../good-collectors/good-collector.rkt" 110)
(allocator-setup "../good-collectors/good-collector.rkt" 112)
; Helper to generate long lists
(define (gen-list x)