clean up mistakes in 21807d3

- remove bogus test case
- fix bug in collector
- fix bug in test
This commit is contained in:
Robby Findler 2013-11-18 21:47:29 -06:00
parent d2fd37c251
commit 1b47cf5898
2 changed files with 4 additions and 16 deletions

View File

@ -32,7 +32,7 @@ allocation
[(closure) [(closure)
(define size (heap-ref (+ addr 2))) (define size (heap-ref (+ addr 2)))
(for ([i (in-range size)]) (for ([i (in-range size)])
(inc-at-addr (+ addr 2 i))) (inc-at-addr (+ addr 3 i)))
(loop (+ addr size 3))] (loop (+ addr size 3))]
[(prim) [(prim)
(loop (+ addr 2))] (loop (+ addr 2))]
@ -115,16 +115,3 @@ allocation
; function number -> boolean ; function number -> boolean
(define (gc:flat? a) (define (gc:flat? a)
(eq? 'prim (heap-ref a))) (eq? 'prim (heap-ref a)))
(module+ test
(require rackunit)
(check-equal? (let ([h (make-vector 7)])
(with-heap
h
(init-allocator)
(define one (gc:alloc-flat 1))
(define clos (gc:closure 'something (list (make-root 'dummy (λ () one) void))))
(gc:alloc-flat 2))
h)
(vector 'prim 1 'closure 'something 0 'prim 2)))

View File

@ -1,5 +1,5 @@
#lang plai/gc2/mutator #lang plai/gc2/mutator
(allocator-setup "../good-collectors/trivial-moving-collector.rkt" 40) (allocator-setup "../good-collectors/trivial-moving-collector.rkt" 100)
;; just some random allocation here ;; just some random allocation here
;; this is really about testing ;; this is really about testing
@ -16,4 +16,5 @@
((let ([x (cons 1 2)]) ((let ([x (cons 1 2)])
(λ (y) (λ (y)
((first y) (first x)))) ((first y) (first x))))
(λ (z) z))) (cons (λ (z) z)
5)))