Skip to content

Commit

Permalink
cs: small memory-accounting simplification
Browse files Browse the repository at this point in the history
Remove an unneeded accounting hook.
  • Loading branch information
mflatt committed Apr 16, 2020
1 parent 4256214 commit 8145434
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
6 changes: 0 additions & 6 deletions racket/src/cs/rumble/memory.ss
Expand Up @@ -189,10 +189,6 @@

;; ----------------------------------------

;; Any value wrapped as `strongly-reachable-for-accounting` will
;; be `cons`ed instead of `weak-cons`ed for accounting purposes
(define-record-type strongly-reachable-for-accounting (fields content))

(define (weaken-accounting-roots roots)
(let loop ([roots roots])
(cond
Expand All @@ -202,8 +198,6 @@
[rest (loop (cdr roots))])
(cond
[(thread? root) (cons root rest)]
[(strongly-reachable-for-accounting? root)
(cons (strongly-reachable-for-accounting-content root) rest)]
[else
(weak-cons root rest)]))])))

Expand Down
5 changes: 2 additions & 3 deletions racket/src/cs/rumble/place.ss
Expand Up @@ -94,9 +94,8 @@
(finish-proc result)))))
;; Must be called within an engine, used for memory accounting:
(define (current-place-roots)
(make-strongly-reachable-for-accounting
(list (place-registers)
(current-engine-thread-cell-values))))]
(list (place-registers)
(current-engine-thread-cell-values)))]
[else
(define (place-enabled?) #f)
(define (fork-place thunk finish-proc) #f)
Expand Down

0 comments on commit 8145434

Please sign in to comment.