diff --git a/racket/src/cs/rumble/memory.ss b/racket/src/cs/rumble/memory.ss index f87b996525..8bbe41e757 100644 --- a/racket/src/cs/rumble/memory.ss +++ b/racket/src/cs/rumble/memory.ss @@ -32,6 +32,12 @@ (define (set-reachable-size-increments-callback! proc) (set! reachable-size-increments-callback proc)) +(define allocating-places 1) +(define (collect-trip-for-allocating-places! delta) + (with-global-lock + (set! allocating-places (+ allocating-places delta)) + (collect-trip-bytes (* allocating-places (* 8 1024 1024))))) + ;; Replicate the counting that `(collect)` would do ;; so that we can report a generation to the notification ;; callback diff --git a/racket/src/cs/rumble/place.ss b/racket/src/cs/rumble/place.ss index c68ee51123..bf8a9d1dad 100644 --- a/racket/src/cs/rumble/place.ss +++ b/racket/src/cs/rumble/place.ss @@ -81,6 +81,7 @@ (define (fork-place thunk finish-proc) (do-prepare-for-place) (fork-thread (lambda () + (collect-trip-for-allocating-places! +1) (init-virtual-registers) (place-registers (vector-copy place-register-inits)) (root-thread-cell-values (make-empty-thread-cell-values)) @@ -93,6 +94,7 @@ (thunk) 0))]) (finish-proc result) + (collect-trip-for-allocating-places! -1) (do-destroy-place))))) ;; Must be called within an engine, used for memory accounting: (define (current-place-roots)