diff --git a/racket/src/cs/compile-file.ss b/racket/src/cs/compile-file.ss index 36f0082aac..c8d3bdd526 100644 --- a/racket/src/cs/compile-file.ss +++ b/racket/src/cs/compile-file.ss @@ -36,6 +36,7 @@ (check-defined 'compute-size-increments) (check-defined 'enable-type-recovery) (check-defined 'make-wrapper-procedure) +(check-defined 'make-phantom-bytevector) ;; ---------------------------------------- diff --git a/racket/src/cs/rumble/memory.ss b/racket/src/cs/rumble/memory.ss index c72369918b..034be584cb 100644 --- a/racket/src/cs/rumble/memory.ss +++ b/racket/src/cs/rumble/memory.ss @@ -324,16 +324,19 @@ ;; ---------------------------------------- (define-record-type (phantom-bytes create-phantom-bytes phantom-bytes?) - (fields [mutable size])) + (fields pbv)) (define/who (make-phantom-bytes k) (check who exact-nonnegative-integer? k) - (create-phantom-bytes k)) + (let ([ph (create-phantom-bytes (make-phantom-bytevector k))]) + (when (>= (bytes-allocated) (* 2 allocated-after-major)) + (collect-garbage)) + ph)) (define/who (set-phantom-bytes! phantom-bstr k) (check who phantom-bytes? phantom-bstr) (check who exact-nonnegative-integer? k) - (phantom-bytes-size-set! phantom-bstr k)) + (set-phantom-bytevector-length! (phantom-bytes-pbv phantom-bstr) k)) ;; ----------------------------------------